>>>>> "E" == Emmanuel Touzery <emmanuel.touzery / wanadoo.fr> writes:

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

 Well, I know nothing in this strange P language but this is not really the 
 reason.

 while (<>) {} is in reality a shortcut for while(defined($_ = <>)) {} (it
 must exist an old version of this strange language where while($_ = <>) {}
 was different from while (<>) {})

 The reason is that if the file don't end with a newline, like you say ""
 is false but defined("") is true

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

 Probably the good question is : what is a line ? do the "line" separator
 belong to the line or not ?


Guy Decoux