Shay Hawkins wrote:
> C:\Users\Shay\Desktop>ruby prg2.rb
> -2
> C:\Users\Shay\Desktop>Hello World!
>>>> Received Hello World! <<<
> -1
> C:\Users\Shay\Desktop>Blah~
>>>> Received Blah~ <<<
> 0
> 
> And so forth and so on.

It returns you to a command prompt? How odd.

What about a threaded version of prg2.rb, does it behave any 
differently?

Thread.new do
  while line = $stdin.gets
    $stderr.puts ">>> Received #{line.chomp} <<<"
  end
end
i = -2
loop do
  $stderr.puts i
  i += 1
  sleep 2
end
-- 
Posted via http://www.ruby-forum.com/.