{ my %monks = ( Zaxo => 'W. Virginia', tye => 'California', theorbtwo => 'Germany', castaway => 'Germany', atcroft => 'Georgia', rozallin => 'England', ); # %monks has a reference count of 1 my $ref = \%monks; # $ref has a reference count of 1 # %monks has a reference count of 2 $monks{myself} = \%monks; # %monks has a reference count of 3 } # leaving the scope decrements the reference count # for %monks and $ref by one. # $ref is collected (has a refcount of 0) # - decrement the reference count for monks # by one again # "%monks" has a reference count of 1 # and is not garbage collected