in reply to Passing hashes by reference

Perl subroutines are indeed pass-by-reference, meaning that the elements of @_ in your sub are exactly the same elements as were passed to it by the caller. If you manipulate the contents of the elements of @_, you change them in the caller. However, if you assign the elements of @_ to another variable before changing them, you only change the new copy of those data. If you want to change the contents of a hash by calling a subroutine, you can do this:
%a = qw(cat dog); print $a{cat}; foo(%a); print $a{cat}; sub foo { $_[1] = "elephant" }
which prints "dog" first, then "elephant".

However, such code is Bad because there's nasty magical action-at-a-distance. In fact, if I saw code like that I would assume it was a bug. You're better off doing this:

%a = qw(cat dog); print $a{cat}; %a = foo(%a); # <-- note assignment print $a{cat}; sub foo { my %temphash = @_; $temphash{cat} = "elephant"; %temphash; }
which, while longer, makes it clearer to someone maintaining your code that the foo subroutine is used to modify the contents of the hash.

Another way would be to explicitly pass the subroutine a reference to the hash and then use the -> operator to modify what the reference refers to. When doing that, it is still common to copy the reference to the hash into a scalar in your subroutine, but when you do that, you can still dereference it and $reference->{wibble} is far easier to read than $_[0]->{wibble}.