Matthew Palmer wrote:

Sure, but why in the name of all that is holy would you do that?  If you
expect to be dealing with a lot of input and don't want to kill your
machine, you'd do something like:

$stdin.each_line { |l| puts l }

In short, I've written several thousand lines of Ruby, a fair amount of it
dealing with IO processing, and I've never once yet used IO#eof -- nor do I
ever intend on doing so.  The iterators available in the IO class can take
care of basically anything you need to do.

The short answer is to illustrate that "$stdin.eof" works.

It's not meant to solve the problems of the world.


O Plameras

_______________________________________________
coders mailing list
coders@slug.org.au
http://lists.slug.org.au/listinfo/coders

Reply via email to