Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Most revered Monks,

I've skimmed through several Config modules on CPAN, yet haven't found something that would allow me to mimic (in a simple way) the behaviour of a typical Unix program: server-wide config (e.g. /etc/foo.conf), overideable by per-user config (~/.foorc), overideable by env var, overideable by command-line args.

Ok, I lied. Actually, App::Options is very nice and very very close. It's just that I want it to support some kind of registry or hierarchical hash too (e.g. specifying config in YAML and then be able to override a branch or node in system-wide config with per-user config). Plus, App::Options doesn't seem to accept "--foo bar", only "--foo=bar". Most Unix programs I know would accept both.

What do you use and/or recommend when writing config system for a Unix program?

Replies are listed 'Best First'.
Re: Config for Unix programs?
by jj808 (Hermit) on Dec 19, 2007 at 15:25 UTC