my %hash = ( all => 'old' ); # simple hash value foo(\%hash); # pass reference to hash sub foo { # recieve reference as $_[0] my $ref = shift; # copy reference to $ref (and throw away $_[0]) $ref->{ all } = 'new'; # overwrite the value to the key 'all' # in the hash pointed to by $ref (which is %hash) }