Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Unusual variable declaration

by LanX (Cardinal)
on Nov 03, 2019 at 12:12 UTC ( #11108273=note: print w/replies, xml ) Need Help??


in reply to Re: Unusual variable declaration
in thread Unusual variable declaration

Addendum:

  • local

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.

  • importing

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11108273]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2021-01-27 19:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?