in reply to Re: favourite config method
in thread favourite config method

One more thing that has worked for me in the past is to also have a central config file ...

This I like, but has problems getting info from it into a use lib line. The config file can contain a lot, but how do you get that and libs into your perl script. This is my question. I'm doing:

use lib '/some/static/path'; use MyModule::Config;

This means I have to change one line per script.

Is this optimal?

--
Steve Marvell

Replies are listed 'Best First'.
Re: Re: Re: favourite config method
by waswas-fng (Curate) on Aug 08, 2002 at 16:52 UTC
    I use:
    use Storable; $global_config = retrieve('/path/to/my/config.sto');
    in my scripts, that way I can access things like $global_config{'logdir'} globally. I have another script which can add/change/delete hash entries and then nstore \%global_config, '/path/to/my/config.sto'; them.
    It seems to load up very quickly and has worked very well for me in the past.

    -Waswas