Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi, I'm writing a program that uses a hash of hashes. At one point this program checks to see if a hash exists within a hash. Much to my suprise, checking for its existence caused that key to come into existence. Below is some sample code that illustrates what I'm talking about:
And it outputs: $foo{bar} popped into existence. This is very confusing to me because I never did anything with $foo{bar} except check to see if it contained a reference to a hash (which I though was supposed to prevent autovivification). My two questions are why does this happen (and why only with a hash of hashes) and how can I test for a hash within a hash without causing the key in question to come into existence? Thanks! In reply to Autovivification with hash of hashes by Mr_Person
|
|