Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: accessing values

by Fletch (Bishop)
on Oct 14, 2020 at 21:20 UTC ( [id://11122844]=note: print w/replies, xml ) Need Help??


in reply to accessing values

As has been mentioned lexicals at a file scope aren't accessible outside that file. What you've written is (more or less) equivalent to trying to do this:

{ my $var1 = "hello"; my $var2 = "perl!"; } print $var1; print $var2;

If you tried to do that under strict you'd get errors immediately because you're trying to access variables after they've gone out of scope. See Coping with Scoping.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2024-04-19 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found