in reply to Testing <> for undefined

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.