sub hasheesh(&\%) { my( $c, $h ) = @_; local( $a, $b ); if ( wantarray ) # list context { @_ = (); while ( ( $a, $b ) = each %$h ) { push @_, $c->(); } return @_; } elsif ( defined wantarray ) # scalar context { my $n; while ( ( $a, $b ) = each %$h ) { my @a = $c->(); $n += @a; } return $n; } else # void context { while ( ( $a, $b ) = each %$h ) { $c->(); } } }