sub increment_my_x { my $h = peek_my (1); ${$h->{'$x'}}++; } my $x=5; increment_my_x; print $x; # prints 6