sub function { my $hashref = shift; $hashref->{three} = 3; } my %hash = ( one => 1, two => 2 ); &function(\%hash); print join(", ", keys %hash); # one, two, three #### sub function (%) { my %hashref = shift; ... } &function(%hash); # passes %hash as a ref #### sub function { my %hash = %{shift}; # de-references $hash{three} = 3; # Does not affect the real %hash! }