in reply to Passing multiple data types to a subroutine
But if you want to pass two distinct arrays and/or hashes, you have to resort to referenecs.foo($bar,$baz,@qux); sub foo { my $bar = shift; my $baz = shift; my @qux = @_; # or my($bar,$baz,@qux)=@_; }
foo(\@arr1,\@arr2); sub foo { my @arr1=@{+shift}; my @arr2=@{+shift}; }
|
---|