in reply to Re^2: loop surprise
in thread loop surprise
if not de-localized, exactly what is the nature of the thing to which $_ would remain aliased after loop exit
Aliasing is an implicit reference to the object that is aliased. Like any referenced object, it would remain until all references to it have been removed.
As for why, to see what was last processed. Sure, you could use an extra variable, but doing so adds more opportunities for introducing bugs.
Besides, according to Larry, laziness is a virtue.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: loop surprise
by Your Mother (Archbishop) on Apr 05, 2018 at 21:00 UTC |
In Section
Seekers of Perl Wisdom