Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: use has it's own scope?

by Eily (Monsignor)
on Sep 06, 2017 at 09:43 UTC ( [id://1198761]=note: print w/replies, xml ) Need Help??


in reply to Re^2: use has it's own scope?
in thread use has it's own scope?

FYI I wondered if B::Deparse could show this. The answer is yes, with level 5 of deparsing or higher, use statments will be translated into their equivalent BEGIN blocks:

perl -MO=Deparse,-x5 -e "use Set my $x = 12;" sub BEGIN { require Set; do { 'Set'->import(my $x = 12) }; } -e syntax OK
I don't think the fact that the lexical has a scope even shorter than the BEGIN block changes anything though.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-28 17:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found