Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Vexed $Package::Var Usage

by Dylan (Monk)
on Dec 17, 2001 at 05:41 UTC ( #132437=note: print w/replies, xml ) Need Help??

in reply to Vexed $Package::Var Usage

That is very good at explaining what you want to know, I won't lecture

my variables, do not have a package name, If I recall Correctly.

my variables are kinda magical. kiat asked about my variables a while ago. You should read it.
The right way, the way that will work anyway, is like so: ------- #!/usr/bin/perl use Bar; print $Bar::Baz; ------- package Bar; our $Baz=42; -------

In older version of perl5, instead of our you would do something like:

use vars qw($Bar); $Bar=42;

You might also search this site for "Variable scope" or something like that.
Well, I hope that helps.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2023-03-21 09:03 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (59 votes). Check out past polls.