Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: OUR declaration

by ioannis (Vicar)
on Sep 23, 2006 at 10:19 UTC ( #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
Node Status?
node history
Node Type: note [id://574498]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-07-04 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls