in reply to Re: Using @ARGV
in thread Using @ARGV
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using @ARGV
by merlyn (Sage) on Dec 03, 2005 at 18:50 UTC | |
by revdiablo (Prior) on Dec 03, 2005 at 21:50 UTC | |
by merlyn (Sage) on Dec 04, 2005 at 01:36 UTC | |
by Joost (Canon) on Dec 04, 2005 at 03:56 UTC |