The stupid question is the question not asked | |
PerlMonks |
Testing for the existence of STDIN?by darkomen (Acolyte) |
on Jan 24, 2002 at 02:46 UTC ( [id://141049]=perlquestion: print w/replies, xml ) | Need Help?? |
darkomen has asked for the wisdom of the Perl Monks concerning the following question:
I want to write some perl code that can detirmine when it has something in STDIN to process.
Ex: echo a | test.pl That should process STDIN... Ex: ./test.pl That should exit without wanting a character entered into STDIN. Whenever you try and read from STDIN, if it is empty, it waits til it has something in it and gets an EOF... I want to basically be able to test.... Is there something in STDIN? Yes - process the contents of STDIN... No - Skip processing STDIN and exit.... Am I being clear at all? Thanks for any advice...
Back to
Seekers of Perl Wisdom
|
|