Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Strange HASH reference BUG! Dual value for a key with sub-key!

by djantzen (Priest)
on May 21, 2003 at 06:45 UTC ( [id://259654]=note: print w/replies, xml ) Need Help??


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.


"The dead do not recognize context" -- Kai, Lexx
  • Comment on Re: Strange HASH reference BUG! Dual value for a key with sub-key!
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://259654]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-24 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found