Quote:
Originally Posted by The Fear
Hi.
$argv1,$argv2,...
all in @ARGV.
example:
./perl sample.pl $argv1 $argv2
@ARGV = $argv1,$argv2
$ARGV[0] = $argv1
$ARGV[1] = $argv2
#Good luck
|
The above code is not quite correct. Perl sends the arguments to the program in the @ARGV array. You get them back out of the @ARGV array like so:
Code:
my ($arg1,$arg2) = @ARGV;
or:
Code:
my $arg1 = $ARGV[0];
my $arg2 = $ARGV[1];