http://qs321.pair.com?node_id=609240


in reply to Location of Conditional test effects results

That's called autovivification IIRC. See:

$ pirl Welcome to the Perl shell. Type ':help' for more information pirl @> %a = () () pirl @> print "ok" if $a{k} undef pirl @> \%a # no surprise {} pirl @> print "ok" if $a{k}[0] undef pirl @> \%a # bang! { k => [] }

When accessing elements of a structure (hash or array ref) in a nested level, you may find out that Perl "helpfully" sprang some structures to life. If you're not ready for this, it may give a lot of headache.

Autovivification issues happen a lot here. See for example Hash Autovivification Weirdness, Re: Array mysteriously growing (autovivification explained), Autovivification of scalars in sub calls, Autovivification for dummies (using Test::More), The Bad, the Ugly, and the Good of autovivification or look for more following the super search http://www.perlmonks.org/?node_id=3989;HIT=vivification.