sub hasheesh(&\%) { my( $c, $h ) = @_; local( $a, $b ); @_ = (); while ( ( $a, $b ) = each %$h ) { push @_, $c->(); } @_ } # you'd use it like this: hasheesh { print "$a => $b\n" } %h; # or: print hasheesh { "$a => $b\n" } %h;