rajiyer has asked for the wisdom of the Perl Monks concerning the following question:
package Test; require Exporter; @ISA =Exporter; use Config::Inifiles; our $my_config = new Config::Inifiles(-file => "config.ini"); sub my_test { print "[ key = ".$my_config->val("section", "key")."]\n"; }
package globals; require Exporter; @ISA = (Exporter); @EXPORT = qw(init, $my_config); use Config::Inifiles; sub init { $my_config = new Config::Inifiles(- file => "config.ini"); } 1;
package Test; require Exporter; @ISA = Exporter; use globals; sub my_test { globals::init(); print "[ key = ".$globals::my_config->val("section", "key")."]\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Global Initialization while embedding Perl
by esskar (Deacon) on Mar 04, 2004 at 05:27 UTC | |
|
use strict, warnings, and check for failure
by Anonymous Monk on Mar 04, 2004 at 08:00 UTC |