Which of both?
I personally find the behaviour of the sub arg aliasing far less surprising.
The other behaviour rather looks like sacrificing logic for performance or easier code logic.
I suppose changing that might be too expensive now, but most code doesn't try to assign to $_ in a loop.
If we are going to keep this behaviour, we'll need to document it properly.
Something like loop aliasing always triggers autovivification
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re^4: unexpected modify hash in a distance with grep { $_ } (inconsistent behaviour of aliasing)
by LanX
in thread unexpected modify hash in a distance with grep { $_ }
by leszekdubiel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |