use warnings; use strict; my %hash_rec; $hash_rec{id} = "001"; doSub1(\%hash_rec); print "back main, id=$hash_rec{'id'}, id2=$hash_rec{'id2'}\n"; sub doSub1 { my ($hash_ref) = @_; print "inside doSub1, id=$hash_ref->{id}\n"; # you're not assigning a reference to $hash_ref->{id2}, # you're assigning a simple string $hash_ref->{id2} = "002"; # you're only sending a scalar string to doSub2()... # $hash_ref->{id2} eq "002" doSub2($hash_ref->{id2}); } sub doSub2 { # $id2_ref is NOT a reference... it's the value of # $hash_ref->{id2}, which is a scalar string only my ($id2_ref) = @_; print "inside doSub2, id2=$id2_ref\n"; # no need to deref this! }