perlquestion
Anonymous Monk
Simple problem for you good folks.
<p>
I want a script that reads both from stdin and from a any file parameter. In other words a script that can be used as any other unix command line tool.
<p>
The problem is that if there's no stdin and no command line args then the script just waits for input.
<p>
I want to test to see if there is any input from a pipe or file and if not close with a usage message.
How can I test, <>?
<p>
Thanks
<code>
use strict;
use warnings;
while (<>) {
print;
}
</code>
10