sub function { our %hash; local *hash = \$_[0]; foreach (keys %hash) { ... } } function(\%hash);