Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: What does $::var means

by Hofmator (Curate)
on Jul 18, 2006 at 13:44 UTC ( [id://562009]=note: print w/replies, xml ) Need Help??


in reply to Re^2: What does $::var means
in thread What does $::var means

For the difference between $var and $::var see the following code:
package Foo; $var = "hello\n"; $::var = "bye\n"; print $var; # hello print $Foo::var; # hello print $::var; # bye print $main::var; # bye package main; print $var; # bye !! print $Foo::var; # hello print $::var; # bye print $main::var; # bye
So - as mentioned elsewhere - $::var is equivalent to $main::var while $var refers to the $var variable in the current package.

-- Hofmator

Log In?
Username:
Password:

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

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

    No recent polls found