From: dblack@... Date: 2002-12-06T03:28:39+09:00 Subject: Re: Best way to read data? Hi -- On Fri, 6 Dec 2002, Jason Persampieri wrote: > Interesting. > > A little bit of testing shows that > > ruby foo.rb < foo.rb > > works, while > > foo.rb < foo.rb > > gives the error Chirstopher is seeing. Why would this > be? Maybe if it's running as an executable without a #! line (so the shell/OS doesn't know it's a Ruby program). > Also, I'm surprised noone recommended 'readlines' > foo.rb > puts readlines > > works fine for me... nice and clean It's different though; it doesn't output anything until EOF (as opposed to one line at a time). print while gets might do it (if one doesn't mind the Perlian magic :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav