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

Re: Unusual variable declaration

by davido (Cardinal)
on Nov 02, 2019 at 21:50 UTC ( [id://11108265]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    our $var; # Declare a variable in the current package.
    *var = \$main::var; # Create an alias in the current package to packag
    +e main's $var;
    
  2. or download this
    package Foo;
    our $var = 42;
    ...
    *var = \$Foo::var;
    print __PACKAGE__, ": $var\n";
    print \$var, "\n";
    
  3. or download this
    Foo: 42
    SCALAR(0x559ec7e7b6a0)
    main: 42
    SCALAR(0x559ec7e7b6a0)
    

Log In?
Username:
Password:

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

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

    No recent polls found