Your best bet is to put input into a variable, and test from here. That avoids icky little "but I didn't mean to read twice!" bugs. Also, direct comparisons are going to be problematic unless you remove the trailing newline that comes with the input. E.g.,
my $input = <>; chomp($input); # remove trailing \n if ( $input eq "" ) { ... }
But none of that helps when you need to be looking at @ARGV instead.
In reply to Re: Testing <> for undefined
by dws
in thread Testing <> for undefined
by kayak9630
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |