⭐ in reply to How do I pass more than one array or hash to a subroutine
If you declare your subroutine with a function prototype specifying each argument as \% or \@, then your method will automatically get a reference to the hashes/arrays passed to it, without the person calling the function/method/subroutine needing to do anything special.
Note that, like all prototypes, this doesn't work when calling the subroutine using & or as a method.
See the 'Prototypes' section of perlsub for more details, or this node for a good example.
|
|---|