Benno wrote:
On Fri Jun 16, 2006 at 20:00:29 +1000, O Plameras wrote:
Matthew Palmer wrote:

Reading the Fine Manual, we discover that your code probably won't work
anyway:
Yes, the two yield exactly the same results as shown below.

#cat t1.rb
#!/usr/bin/env ruby
puts $stdin.readline while not $stdin.eof

#cat t2.rb
#!/usr/bin/env ruby
puts $stdin.readlines while not $stdin.eof

I think the key difference here is the number of times the loop is
execute. That is going to be different, and understanding that
difference is probably extremely important to those in the learning
Ruby SIG.

So, does the difference matters when the results are the same ? Programs worked
for me when I get the results I want.

Can anyone illustrate an instance where the results are different between readline and
readlines in the context of the original post ?

I'm keen to learn, too.


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

Reply via email to