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

Re^2: OUR declaration

by ioannis (Prior)
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 romping around the Monastery: (11)
As of 2016-07-01 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (410 votes). Check out past polls.