right, but be careful because AnomalousMonk warned that exists() will autovivify in some cases. Perhaps you want to run your program with and without no autovivification; and diff your resultant data structure.
| [reply] [Watch: Dir/Any] [d/l] [select] |
use Data::Diver qw/ Dive /;
print Dive( \%hash, qw/ key0 key1 key2 /); ## doesn't alter %hash
| [reply] [Watch: Dir/Any] [d/l] |
Yes, as other "Anonymous Monks" have said – a feature. Because, if you are legitimately trying to use something like $hash{'www'}{'xxx'}{'yyy'}{'zzz'}, it is "hugely convenient" that Perl will automagically create $hash{'www'} then $hash{'www'}{'xxx'} then $hash{'www'}{'xxx'}{'yyy'}, and maybe even $hash{'www'}{'xxx'}{'yyy'}{'zzz'}, all without asking. This very simple trick bypasses a lot of tedium and is "usually" beneficial. Just not in your case! | [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |