in reply to Re^2: Packaging up my code sensibly
in thread Packaging up my code sensibly

Isn't what you need is a singleton object to store your values? Something that you'll call like this :
use MyModules::Config; # here's the singleton magic: # "new" recalls the existing instance if any. my $conf=Config->new();
from each script. And the Config package would look like this :
package Config; # this is the package variable to store # the used instance my $single; # modules use Carp; sub new { # usual stuff here... my $proto = shift; # create a new object if no instance currently active unless ($single) { $single = {} ; # where to store data $single->{options} = {}; } bless($single); return $single; } # here is the method to parse the conf. file # and load the data in the Config object sub parseconffile { my $config = shift; # here put something useful... } # end 1;
This way, all your modules can share the same config without passing any parameter around : just call my $conf=Config->new() from each module, the first to call it will load the configuration data, the others will simply share that instance.