[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    why won't ruby chomp for me?
From:       Emmanuel Touzery <emmanuel.touzery () wanadoo ! fr>
Date:       2004-01-29 15:04:30
Message-ID: 4019218D.50700 () wanadoo ! fr
[Download RAW message or body]

Hello,

    I was wondering.. IIRC, Perl came up with this "\n" in the end of 
line in gets etc because in Perl, "" is false. So, if you want to have:
while (<>) {print $_;}
    working, you needed that even empty lines won't be "false". So they 
said that they will put the "\n" in the line, and problem is gone, nice 
hack etc.

    but in ruby, "" is true, so i'm wondering... why did ruby take this 
over from perl? i find myself many times forgetting that chomp and the 
fact ruby offers me the "raw" line format never ever helped me in any 
way. is it just historical praise to Perl?

    just curious,

emmanuel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic