You can pass the entire hash as a hash reference. This would also make things more efficient. Here is the sample code:
my %hash_outside;
$hash_outside{'first'} = 'first value';
$hash_outside{'second'} = 'second value';
sub blah {
my %hash = %{ +shift; };
foreach my $k (keys %hash) {
print "$k -> " . $hash{$k} . "\n";
}
}
&blah(\%hash_outside);
Here you pass a hash reference to the sub by appending a backslash ( \%hash_outside ). First line in the sub dereferences the reference to the hash so you can use it as a normal hash.
You could also look at perlref documentation to find out more about references.