shift(), when used outside a subroutine shifts the first element off @ARGV. Another way of accessing the first element would be:open my $fh, shift or die "Cannot open file: $!\n";
open my $fh, $ARGV[0] or die "Cannot open file: $!\n";
See also perldata, perlvar and shift
In reply to Re^2: Using @ARGV
by Joost
in thread Using @ARGV
by Tech77
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |