sub printElement(\%$) { my %hash1 = %{($_[0])}; my $key = $_[1]; print $key." ".$hash1{$key}."\n"; ... &printElement(\%hash, $key);