"be consistent" | |
PerlMonks |
Re: exists() unexpected behaviorby MrNobo1024 (Hermit) |
on Apr 12, 2001 at 05:16 UTC ( [id://71916]=note: print w/replies, xml ) | Need Help?? |
When you access part of a multidimentional hash, even if you're only using exists(), it creates all the keys except the last one. So if you call exists $foo{'bar'}{'baz'}{'qux'}, it creates $foo{'bar'} and $foo{'bar'}{'baz'}, but not $foo{'bar'}{'baz'}{'qux'}. If you don't want that to happen, you have to test every level, starting with the top:
In Section
Seekers of Perl Wisdom
|
|