- or download this
$ cat argvtest.pl
printf "I saw %d arguments\n",$#ARGV+1; #show how many
@argsin=@ARGV; # Snarf in the argnuments
printf "They were \"%s\"\n",join(",",@argsin); # and what
- or download this
$ perl argvtest.pl 1 2 3 4
I saw 4 arguments
They were "1,2,3,4"
- or download this
if ( $#ARGV < 0 ) { # NOTE: not != 0
printf "I expected an argument not simple refutation\n";
exit(0);
}
- or download this
@RecievedArray=$ARGV[0];
- or download this
use Data::Dumper;
...
printf "Second array:\n";
print Dumper(\@ry2);
- or download this
First array:
$VAR1 = [
...
$VAR1 = [
'a'
];