Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: 'our' scoping

by thospel (Hermit)
on Jun 02, 2004 at 03:08 UTC ( [id://359083]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    
    ...
    # The lexical (second) one still wins.
    
    print $bar; # works, prints $foo::bar even though we are in baz
    
  2. or download this
    use strict;
    
    ...
    package baz;
    # $bar has only one meaning, access $baz::bar
    print $bar; #error
    
  3. or download this
    package foo;
    print $bar;   # prints the global $foo::bar
    
    package baz;
    print $bar;   # prints the global $baz::bar
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found