See autovivification, a pragma (available from CPAN) that can lexically disable autovivification (the behavior). Here's an example from perlfaq4:
{ no autovivification; my %hash; if( exists $hash{key1}{key2}{key3} ) { ...; } }
The faq also suggests a few other techniques.
Dave
In reply to Re: Undesirable parent hash keys
by davido
in thread Undesirable parent hash keys
by sophate
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |