note
haukex
<p>A very good point!</p>
<blockquote><i>Note also that in deeply nested hashes, [doc://exists] will autovivify intermediate levels of the hash in the process of testing the existence of a low level element.</i></blockquote>
<p>To be nitpicky, it's not [doc://exists], but the hash accesses preceding the <c>exists</c> call.</p>
<p>Anyway, I just wanted to point out that the ugly-but-entirely-core way to avoid the autovivification in this example is:</p>
<c>
print 'yes'
if exists $hash{www}
&& exists $hash{www}{xxx}
&& exists $hash{www}{xxx}{yyy}
&& exists $hash{www}{xxx}{yyy}{zzz};
</c>
<p>Although as I described in a [id://11112863|recent thread], I try to keep my hash accesses fairly simple.</p>
11113064
11113071