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
In reply to Re: Persistant variable/data/object?
by antirice
in thread Persistant variable/data/object?
by asiufy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |