Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Config files in CPAN modules?

by fmerges (Chaplain)
on Jul 22, 2006 at 10:50 UTC ( #562996=note: print w/ replies, xml ) Need Help??

in reply to Config files in CPAN modules?


Normally what I do is asking the user to provide the configuration, could be the config itself, or the path to the configuration file:

MyModule->new({ config_file => 'file.conf'}); # or MyModule->new({ config => \%Config }); # or MyModule->load_config($file); # etc...

This way it's up to the users script to decide which method he uses to provide the modules with the configuration settings.

Or going for well known places where the config files should be (linux -> /etc or /usr/local/etc) could be with subdir for the application itself or so; or the other way is to create a hierarchy for the application itself:

MyApp | +-- bin/ +-- etc/ +-- lib/ +-- docs/

But the most important thing of all is to DOCUMENT it. So that the user know how he must do instead of figuring it out. ;-)


fmerges at

Comment on Re: Config files in CPAN modules?
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://562996]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2015-11-28 02:42 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (737 votes), past polls