sub name { # this puts the passed list into a hash my %arg = @_; # this transfers values to variables and removes the keys my ($key1, $key2) = delete @arg{qw(key1 key2)}; # this determines if any keys are leftover croak 'Illegal arguments' if %arg; }
In reply to Re: Passing hashes as arguments to a sub?
by eff_i_g
in thread Passing hashes as arguments to a sub?
by Spidy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |