$hash_ref = modifyHash(\%my_hash); %my_hash = %{$hash_ref}; # hash is now modified sub modifyHash() { my $hash_ref = shift; my %sub_hash = %{$hash_ref}; # Do something to the hash $sub_hash{'test'}=1; return (\%sub_hash); }