use strict; my %hash = (); $hash{a}{drinks}=1; $hash{b}{drinks}=2; print keys %hash; ## printed a b print map { $hash{$_}{drinks} } keys %hash; ## printed 1 2 my $p = \%hash; my %copy = %{ $p }; print keys %copy; ## printed a b ## - fine, %hash has been copied to %copy $copy{c}=3; print keys %hash; ## printed a b ## - ok, %copy is something else ## and %hash won't change when %copy changes. print "REF_HASH=", \%hash, ", REF_copy=", \%copy; ## REF_HASH=HASH(0xcfbf0c), REF_COPY=HASH(0xd05168) ## - yup, they're different indeed. $copy{a}{drinks}=4; print map { $hash{$_}{drinks} } keys %hash; ## printed 4 2 !?!?!?! ## I don't get it! ## Why did %hash change here but didn't before, ## when I added the new key 'c'?