my %hash = ( all => 'old' ); # simple hash value foo(\%hash); # pass reference to hash sub foo { # recieve reference aliased as $_[0] my $ref = shift; # copy reference to $ref (and throw away the $_[0] alias) $ref = { all => 'new' }; # overwrite the copy of $ref # this creates a *new* hash and a new reference in $ref # %hash is not modified }