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"; }