#!perl -w use strict; my %hash = ( a => 1, b => 2, c => 3 ); sub change { my $hash = shift; $hash->{c} = 4; } change( \%hash ); for my $key (sort keys %hash) { print "$key : $hash{$key}\n"; } __END__ Output looks like: a : 1 b : 2 c : 4