in reply to Passing Hash to Subroutine

If I pass a reference to a hash into a sub, I keep working with the reference:

some_sub(\%some_hash); sub some_sub { my $hash_ref = $_[0]; ## Now communicate with hash using: ## $hash_ref->{'SOME_KEY'} returns the value for SOME_KEY ## or ## $hash_ref->{'OTHER_KEY'} = "foo" will set a key to a value ## etc. ## Or the slightly more exciting: ## foreach $key (keys %{$hash_ref}) { ## do_something_with $hash_ref->{$key} }