in reply to No autovivification, for loop aliasing, lvalue vs rvalue in for loops

> and why square brackets make so much difference to autovivification?

this

for my $e (@{[ $$n{'y'} ]}) { }

has no possible autovivification. It copies the list within [] and translates to

for my $e (@{[ undef ]}) { }

Nota Bene: there is a fundamental difference between \@a and [@a] !

While both are array refs, only the first one keeps a link to @a while the latter is only an anonymous copy.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!