------art_13322_3417944.1116105604111
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

here's a summary of a script I just wrote:

while (true) do
puts "Make your selection from the list below: \n\n"
puts "a) foo\n"
puts "b) bar\n\n"
gets
handle_action($_)
end

handle_action does stuff that isn't relevant to my question.

The program works fine except when I hit CTRL-D. After I hit CTRL-D, the 
program runs in an endless loop and seems to skip over the gets statement. 
Doesn't look good, I can't even break out of it (CTRL-C). Of course CTRL-D 
indicates end of file. My guess is that this closes STDIN.

I just thought of a "work around", consisting of inserting

exit unless $_

after the gets statement

I think it might be better to simply re-open STDIN as if nothing had 
happened.. is this a good idea and is it possible?

Thanks,

-- 
David Vincelli

------art_13322_3417944.1116105604111--