in reply to Returning an error message when <STDIN> is not in use
I'm not at all sure what this has to do with STDIN, but it sounds like you just want to count the number of arguments passed to your program.
unless (@ARGV) { # error }
If I'm misunderstanding and you want to check whether STDIN is connected to the console, then you can use the -t file test operator.
if (-t STDIN) { # STDIN is connected to the console }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning an error message when <STDIN> is not in use
by jonadab (Parson) on Nov 09, 2006 at 16:02 UTC | |
|
Re^2: Returning an error message when <STDIN> is not in use
by chinamox (Scribe) on Nov 10, 2006 at 05:43 UTC |