in reply to Strange HASH reference BUG! Dual value for a key with sub-key!

What you've done is used a symbolic reference to create a second hash %k1.

use Data::Dumper; my $hash = {} ; $hash->{key1} = 'k1' ; $hash->{key1}{key2} = 'k2' ; print ">> $hash->{key1}\n" ; print ">> $hash->{key1}{key2}\n" ; print Dumper $hash; print Dumper \%k1; ^Z >> k1 >> k2 $VAR1 = { 'key1' => 'k1' }; $VAR1 = { 'key2' => 'k2' };

As you don't have strict turned on, the value of $hash{key1} was used as the hash name in the second assignment and it was autovivified for you. And again when interpolated in the print statement.

You told the compiler you knew what you were doing (by not useing strict), so it went right ahead and did what you asked:) He he.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller