in reply to Re^6: declaring lexical variables in shortest scope: performance?
in thread declaring lexical variables in shortest scope: performance?
A nickname for something, which behaves in all ways as though you’d used the original name instead of the nickname. Temporary aliases are implicitly created in the loop variable for foreach loops, in the $_ variable for map or grep operators, in $a and $b during sort’s comparison function, and in each element of @_ for the actual arguments of a subroutine call. Permanent aliases are explicitly created in packages by importing symbols or by assignment to typeglobs. Lexically scoped aliases for package variables are explicitly created by the our declaration.
just search and you'll find many discussions in the archive regarding the complicated mechanisms involved here, including the divide between package and private vars, closure inside the loop, etc ...
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: declaring lexical variables in shortest scope: performance?
by bliako (Abbot) on Mar 31, 2020 at 12:41 UTC | |
by Your Mother (Archbishop) on Mar 31, 2020 at 16:17 UTC | |
by LanX (Saint) on Mar 31, 2020 at 14:33 UTC |