sub myfunc { my %hash = @_; print $hash{foo}, "\n"; } my %h = ( foo => 'bar' ); myfunc(%hash); myfunc( foo => 'baz' );