Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: how do i create a global var conditionally?

by AnomalousMonk (Archbishop)
on Mar 02, 2018 at 16:07 UTC ( [id://1210237]=note: print w/replies, xml ) Need Help??


in reply to Re: how do i create a global var conditionally?
in thread how do i create a global var conditionally?

... the global you want to create ...

But be aware that  my @globalarray; still declares a lexical variable: it is not visible to any code prior to the point of declaration, and it is not visible in any other source file in the application. If a lexical is declared very early in a source file (update: and if it's not declared in a block scope of any kind, i.e., if it's "in file scope") and if there is only one source file in the application, then a lexical can give a pretty darn good imitation of a global, but it's still a lexical.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^3: how do i create a global var conditionally?
by rizzo (Curate) on Mar 09, 2018 at 17:29 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-26 03:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found