From: Robert Klemme Date: 2010-01-13T20:53:40+09:00 Subject: Re: SPOJ ? Test for end of file input 2010/1/12 Aldric Giacomoni : > Brian Candler wrote: >> >> gets will return nil on end of file. >> >> while line = $stdin.gets >>   line.chomp! >>   puts "I got #{line} !!" >> end >> > Ah! And the light comes on and blinds me. Thank you! I would do $stdin.each do |line| line.chomp! puts "I got #{line} !!" end because that is the more Ruby typical idiom for iterating all lines. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/