see mugwumpjism's prior art in his response to the mapcar -- map for more than one list node.
code here for those too lazy to click above...
sub mapeach (&\%) { my $sub = shift; my $hash = shift or do { require Carp; Carp::croak( "mapeach: Nothing to map" ); }; my @ret; while ( my ($k, $v) = each %{$hash}) { local ($_) = $k; push @ret, $sub->($k, $v); } return wantarray ? @ret : { @ret }; }
~Particle *accelerates*
In reply to Re: map-like hash iterator
by particle
in thread map-like hash iterator
by jdporter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |