use strict; use warnings; my %hash=("bob" =>123, "tom" => "CAT"); #Assign values change (\%hash); #Print New Values print "$_ = $hash{$_}\n" foreach keys %hash; sub change{ my $hashRef = shift; #Get the reference to the values foreach (keys %$hashRef){ print "$_ = $hashRef->{$_}\n"; $hashRef->{$_} .= "hello"; #Change Values } } #### tom = CAT bob = 123 tom = CAThello bob = 123hello