in reply to Re: How to declare arrays and scalars together?
in thread How to declare arrays and scalars together?
"Remember why you can not pass multiple arrays to a subroutine?"
except, one uses reference like so:
my $arr1_ref = [ 1, 2, 3 ]; my $arr2_ref = [ 10, 9, 8, 7 ]; load_arr( $arr1_ref, $arr2_ref ); ## load multiple array references sub load_arr { my ( $arr1_def, $arr2_def ) = @_; print join "\n", @{$arr1_def}, @{$arr2_def}; return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to declare arrays and scalars together?
by Anonymous Monk on Jun 18, 2012 at 16:49 UTC | |
by 2teez (Vicar) on Jun 18, 2012 at 19:32 UTC | |
by Anonymous Monk on Jun 19, 2012 at 01:59 UTC |