How can I determine if there's input waiting on STDIN before calling
gets? This code doesn't do the trick:
----
while true
r, w, e = select [$stdin], [], [], 1
if r and r.include? $stdin
puts "READY TO READ!"
end
end
-----
Apparently, r always includes $stdin, so it just continuously prints
"READY TO READ".
--
Bill Atkins