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

Re: Sharing Across Packages

by Velaki (Chaplain)
on Sep 29, 2006 at 11:55 UTC ( [id://575510]=note: print w/replies, xml ) Need Help??


in reply to Sharing Across Packages

The main package scoped variable $MW is not available inside the package BPP::About.

Where do you call AboutBPP? You could always call it as

AboutBPP($MW);
if it's from the main program.

And then all you would have to do is add to AboutBPP

my $MW = shift;

Hope this helped,
-v

"Perl. There is no substitute."

Replies are listed 'Best First'.
Re^2: Sharing Across Packages
by polettix (Vicar) on Sep 29, 2006 at 12:46 UTC
    The main package scoped variable $MW is not available inside the package BPP::About.
    "Package scoped variables" are package variables, they're always accessible using the fully qualified name (like $main::MW). When dealing with our, the only thing you're "scoping" is the possibility to use the non-fully-qualified symbol ($MW) instead of the fully qualified one ($main::MW).

    Flavio
    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Don't fool yourself.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-26 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found