The stupid question is the question not asked | |
PerlMonks |
Re: Using stdin only if there is input on it, but skipping it if there is no databy Fletch (Bishop) |
on Nov 18, 2020 at 07:48 UTC ( [id://11123772]=note: print w/replies, xml ) | Need Help?? |
First thing that comes to mind is if @ARGV were empty (you're given no filenames) then check if -t STDIN is true (meaning it's a tty device not a pipe).
The cake is a lie.
In Section
Seekers of Perl Wisdom
|
|