in reply to Need help working with STDIN

Probably the simplest thing to do is to test whether STDIN is connected to a tty, using the -t operator.
sub prompt { -t STDIN and print "\n? "; } while ( prompt(), defined($_=<STDIN>) ) { chomp; print "$_\n"; }

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.