Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: local vs my

by Aristotle (Chancellor)
on Sep 02, 2002 at 20:30 UTC ( [id://194631]=note: print w/replies, xml ) Need Help??


in reply to Re^2: local vs my
in thread local vs my

There's quite a difference between a true global variable (as defined with use vars or our or my at file scope), and something like $Package::variable (which is also global in the sense that it's accessible from outside of the package that defined it).
That's not true. Do not confuse file scoped lexicals variables such as my and our can declare with package scoped globals ones which is what the vars pragma declares, which are exactly $Package::variables.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^3: local vs my
by Anonymous Monk on Sep 03, 2002 at 03:04 UTC
    Do not confuse file scoped lexicals such as my and our can declare with package scoped globals

    And do not confuse variables declared with our as anything other than the same package globals as those declared with 'use vars' or accessed by full package name. The only difference is in the scope of the unqualified access! In particular, our does not involve lexical variables at all.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-28 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found