![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
Re: How to pass two lists to a sub?by Prior Nacre V (Hermit) |
on Nov 05, 2004 at 12:06 UTC ( #405474=note: print w/replies, xml ) | Need Help?? |
To do this, pass references to the arrays and dereference in the subroutine:
Another way is to pass all parameters in a hashref:
The second method involves more coding but provides a number of benefits:
Update: Added missing line: process_something($rh_params); Regards, PN5
In Section
Seekers of Perl Wisdom
|
|