Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Require Centralized Variables

by axelrose (Scribe)
on Dec 05, 2002 at 09:47 UTC ( #217715=note: print w/replies, xml ) Need Help??


in reply to Require Centralized Variables

Another possible solution I prefer is to avoid having variables in the required script
# main script require "conf.pl"; my $conf = get_conf(); print $conf->{foo}; ... # conf.pl sub get_conf { { foo => "bar", color => "red" } } 1;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2023-12-10 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (38 votes). Check out past polls.

    Notices?