>>>>> "k" == kwatch  <kwatch / lycos.jp> writes:

k> It shows that '$stdin.eof?' stops the progress.

 To know if the stream is at EOF ruby try to read from this stream.

 For your example prog4.rb

  * the first $stdin.gets read `hoge' and store it in `line'
  * the call $stdin.eof? 
      1) test the EOF indicator of the stream (an EOF was previously found)
      2) look if it exist characters availables in the internal buffer
         of the stream, if yes then it's not at eof?
      3) otherwise it try to read a character on the stream, and just look
         if it was possible or not

 It stop the progress because ruby is trying to read from the stream.


Guy Decoux