I always used to accept my params within a hashref, but in the last year or so, I've changed to just using a straight up hash instead. I feel it makes the interface a tiny bit cleaner:
mysub(a => \@array1, b => \@array2); sub mysub { my %params = @_; print "$_\n" for @{ $params{a} }; }
In reply to Re^2: Pass Arrays to a subroutine
by stevieb
in thread Pass Arrays to a subroutine
by sankoshy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |