in reply to Persistant variable/data/object?
Yes. You can do something like:
package MyConfiguration; our @EXPORT = "get_config"; use base "Exporter"; our $CONFIG = load_vars(); sub get_config() { $CONFIG } sub load_vars { ... } 1;
Then you just use MyConfiguration; everywhere you need to access the configuration and call get_config whenever you need it.
Update: liz was kind enough to point out that "use" isn't spelled "base" ;-)
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Persistant variable/data/object?
by TomDLux (Vicar) on Jan 08, 2004 at 22:46 UTC | |
|
Re: Re: Persistant variable/data/object?
by asiufy (Monk) on Jan 08, 2004 at 21:14 UTC |