Passing Array as a Parameter in PERL
By ET
There are more than two ways to do it. I just put down two quick ways.
- using reference to array
- not using reference to array
Method 1:
In program:
processarray(\@array);
In sub processarray:
my $arrayref=shift;
my @array=@$arrayref;
Method 2:
In program:
processarray(@array);
In sub processarray:
my @array=@_;
