my %a; my $a_ref = \%a; &resetCounters(); &add($a_ref); print $a{'modified'} . "\n"; print $a{'removed'}; sub resetCounters { $a{'added'} = 0; $a{'removed'} = 7; $a{'modified'}++; print $a{'modified'} . "\n"; } sub add { my $a_ref2 = shift; my %temp = %{$a_ref2}; $temp{'modified'}++; foreach (keys %temp) { print $_ . " " . $temp{$_} . "\n"; } }