in reply to Passing hash reference to a subroutine

Consider this

#!/usr/bin/perl use warnings; $fruit{'Apple'} = "Red"; $myHashref=\%fruit; &mysubrtn($myHashref); sub mysubrtn() { local *myref = shift ; test(); } sub test { print $myref{'Apple'},"\n"; }

This will print "red", because you created a globally visible variable. No problem for small scripts, but in bigger programs that approach is as sensible as using globally defined variables.

Also maintainability might suffer because you are hiding the fact that a variable is a reference. Again no problem for small scripts, not advisable in bigger projects