in reply to Re^3: unexpected modify hash in a distance with grep { $_ } (inconsistent behaviour of aliasing)
in thread unexpected modify hash in a distance with grep { $_ }
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: unexpected modify hash in a distance with grep { $_ } (inconsistent behaviour of aliasing)
by dave_the_m (Monsignor) on Dec 21, 2019 at 00:01 UTC | |
by LanX (Saint) on Dec 21, 2019 at 18:50 UTC |