Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: OUR declaration

by ikegami (Patriarch)
on Sep 23, 2006 at 03:35 UTC ( [id://574483]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $var = "value";
    print($main::var eq "value" ? "true" : "false", "\n");  # true
    
  2. or download this
    our $var = "value";
    print($main::var eq "value" ? "true" : "false", "\n");  # true
    
  3. or download this
    package Test;
    $var = "value";
    print($Test::var eq "value" ? "true" : "false", "\n");  # true
    
  4. or download this
    our $var;
    package Test;
    $var = "value";
    print($Test::var eq "value" ? "true" : "false", "\n");  # false
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-26 04:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found