use strict; use warnings; my %hash = (1,'a',2,'b',3,'c'); mysub(\%hash); sub mysub { my %h = %{shift()}; print $h{2}; }