Spidy has asked for the wisdom of the Perl Monks concerning the following question:
Greetings, fellow monks.
I am currently working on a project that, like every other project, needs a config file.
I've read about a few options for handling the need for config files - from building a parse for name=value pairs to just having a config.pm that has all my configuration stuff inside it, to using Config::foo, and so on.
Long story short, I'm no longer certain which format to use(or how to accomplish it).
I need the config file to be able to contain Perl code, which means I can't use the first method I mentioned.
However, I'd also like it to insinuate its data into a global %config hash - so that I can refer to it from anywhere within my collection of scripts by simple doing this:
use config; print $config{foo};
Does anyone have any recommendations on how to implement this in Perl, or a module I could use that would help me accomplish this?
Thanks,
Spidy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Config file recommendations?
by samtregar (Abbot) on Mar 19, 2008 at 03:40 UTC | |
|
Re: Config file recommendations?
by kyle (Abbot) on Mar 19, 2008 at 03:57 UTC | |
by Spidy (Chaplain) on Mar 19, 2008 at 14:52 UTC | |
by kyle (Abbot) on Mar 19, 2008 at 15:21 UTC | |
by Spidy (Chaplain) on Mar 19, 2008 at 18:19 UTC | |
by kyle (Abbot) on Mar 19, 2008 at 21:18 UTC | |
| |
|
Re: Config file recommendations?
by dwhite20899 (Friar) on Mar 19, 2008 at 16:53 UTC | |
|
Re: Config file recommendations?
by hangon (Deacon) on Mar 19, 2008 at 14:50 UTC |