Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This is broken. It will falsely return false for keys which exist but point to a value equal to 0 or the empty string. Nor does it solve the problem at hand, because exists $hashref->{KEY} will not autovivify that key into a hashref either. It is only when you try something like exists $hashref->{LEVEL1}->{LEVEL2} that the level one key is automagically created. But in that case, defined $hashref->{LEVEL1}->{LEVEL2} will do the same. So your "solution" adds a new problem without solving the existing one. Makeshifts last the longest. In reply to Re^2: Autovivification with hash of hashes
by Aristotle
|
|