From: Christophe Broult Date: 2001-08-24T21:01:59+09:00 Subject: [ruby-talk:20275] Re: ruby accessing variables it doesn't nee d to? This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C12C94.8DB38920 Content-Type: text/plain > -----Original Message----- > From: Joseph McDonald [mailto:joe@vpop.net] > Sent: Thursday, August 23, 2001 10:20 PM > To: ruby-talk@ruby-lang.org; Stephen White > Cc: ruby-talk@ruby-lang.org > Subject: [ruby-talk:20233] Re: ruby accessing variables it > doesn't need > to? > > > > SW> Having mail problems, so you may see this 3 times or not > at all. I give > SW> up after this. :) > > SW> Looks like you're heading towards: > > SW> def getschomp > SW> gets ? $_.chomp : nil > SW> end > > I just got one copy of this message :-) > > yes, something like that, but that doesn't chomp the line either. Just curious: on which platform are you using Ruby? On Windows NT, using the cygwin based Ruby, I had to use: def removeEOL(line) line. chomp("\r\n"). chomp end > > I'm mainly curious why things are working the way they are. I have a > feeling I'm missing something fundamental. > > thanks, > -joe > ------_=_NextPart_001_01C12C94.8DB38920 Content-Type: text/html RE: [ruby-talk:20233] Re: ruby accessing variables it doesn't need to?

> -----Original Message-----
> From: Joseph McDonald [mailto:joe@vpop.net]
> Sent: Thursday, August 23, 2001 10:20 PM
> To: ruby-talk@ruby-lang.org; Stephen White
> Cc: ruby-talk@ruby-lang.org
> Subject: [ruby-talk:20233] Re: ruby accessing variables it
> doesn't need
> to?
>
>
>
> SW> Having mail problems, so you may see this 3 times or not
> at all. I give
> SW> up after this. :)
>
> SW> Looks like you're heading towards:
>
> SW>   def getschomp
> SW>     gets ? $_.chomp : nil
> SW>   end
>
> I just got one copy of this message :-)
>
> yes, something like that, but that doesn't chomp the line either.

Just curious: on which platform are you using Ruby?
On Windows NT, using the cygwin based Ruby, I had to use:

  def removeEOL(line)
    line.
      chomp("\r\n").
      chomp
  end

>
> I'm mainly curious why things are working the way they are.  I have a
> feeling I'm missing something fundamental.
>
> thanks,
> -joe
>

------_=_NextPart_001_01C12C94.8DB38920--