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

Re: our scope and packages

by betterworld (Curate)
on Aug 28, 2008 at 23:09 UTC ( [id://707627]=note: print w/replies, xml ) Need Help??


in reply to our scope and packages

I'd suggest using Exporter:

# Module1.pm package Module1; our %variable; use base 'Exporter'; our @EXPORT_OK = qw(%variable); %variable = ( foo => "foo" ); # Module2.pm package Module2; use Module1 qw(%variable); print $variable{foo};

However, if you plan to use this variable to exchange data between the modules, I'd suggest using subroutine arguments instead.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-03-29 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found