#2 : Unless and Exitmy $infile = shift || die usage() ; my $outfile = shift || die usage() ; sub usage () { print "usage : prog foo bar\n" ; }
#3 : Unless and Dieunless(@ARGV == 2) { print "usage : prog foo bar\n" ; exit(1) ; } my ($infile, $outfile) = @ARGV ;
die "usage : prog foo bar\n" unless (@ARGV == 2) ; my ($infile, $outfile) = @ARGV ;
In reply to Best practices for processing @ARGV ? by gu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |