in reply to Strange HASH reference BUG! Dual value for a key with sub-key!
You're inadvertently creating a symbolic reference by using the string 'k1' as a hash. Using the 'V' option under the perl debugger you'll see something like the following (Note: I removed the my declaration so the original hash would show up in the symbol table) :
%hash = ( 'key1' => 'k1' ) ...... ...... %k1 = ( 'key2' => 'k2' )
Just one more reason to use strict :) Note as well that it doesn't matter if it's a hash or hashref.
|
|---|