in reply to Re: Unusual variable declaration
in thread Unusual variable declaration
I almost always use this construct with local except if I want to alias globally.
local *var = \$main::var;
Otherwise any later use of $My::var in another scope will also be aliased.
Should also be mentioned that typeglob aliasing is the essential underlying mechanism Exporter is using.
Though mostly for subs not vars and always globally.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|