Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: OUR declaration

by ioannis (Abbot)
on Sep 23, 2006 at 10:19 UTC ( [id://574498]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my  $foo  = 1;
    our $foo = 2;
    print $foo  ; # prints 2
    
  2. or download this
    our $foo  = 2;
    my  $foo  = 1;
    print $foo  ; # prints 1
    
  3. or download this
    no warnings;
    
    ...
    package Bar;
    no strict;
    print 'Bar: '. $foo, "\n";   # $foo is undefined
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-25 08:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found