in reply to passing hashes and hash reference

You can achieve what you want using subroutine prototypes, so long as you predeclare them. You can learn more on the perlsub manpage. Look at the sections on "Pass By Reference" and "Prototypes".

When you say

myroutine(%hash);
then %hash is passed to myroutine() as a list. This means that in
%hash = ( 'alpha' => 'alpher', 'beta' => 'bethe', 'gamma' => 'gamow'); myroutine(%hash); sub myroutine { print shift, "\n"; }
will print, randomly, either 'alpha', 'beta', or 'gamma'. (In practice, it'll print 'gamma', but in principle the order is undetermined.)

stephen