in reply to passing arrays to asubroutine
You need to pass references to the arrays, rather than the array itself, so the call to your subroutine would look like: subroutine(\@array1, \@array2 ...)
Your subroutine would then use them like this:
sub subroutine { my ($array_ref1, $array_ref2) = @_; your code here }
To access the elements of the array oyu need to dereference it. To access the nth element of the array you can use ${$array_ref1}[n] or equivalently $array_ref1->[n].
Try looking at perlref for more details
|
|---|