|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Re: Checking if hash value exists without implicitly defining itby Kenosis (Deacon) |
| on Feb 14, 2013 at 16:31 UTC ( #1018752=note: print w/ replies, xml ) | Need Help?? |
|
One option is to short circuit the autovivification:
Output:
Update I: Added the needed defined, in case of an earlier (for example) $Hash{$neededVal}{param1}{key1} = 0. Update II: Replaced defined with exists. Thank you, choroba.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||