sub myfunc { my $href = shift; print $href->{foo}, "\n"; } my %h = ( foo => 'bar' ); myfunc(\%h);