You can use a list of keys as indices into a hash. It's called a hash slice, and it's very very nice.sub _sum { my $hash = shift; my $total = 0; $total += $_ for @$hash{ @_ }; return $total; }
In reply to Re: sum function
by chromatic
in thread sum function
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |