in reply to Undesirable parent hash keys
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Undesirable parent hash keys
by sophate (Beadle) on Jan 16, 2013 at 06:20 UTC |
In Section
Seekers of Perl Wisdom