Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Which configuration module?

by andreas1234567 (Vicar)
on Oct 20, 2006 at 08:50 UTC ( #579530=perlquestion: print w/replies, xml ) Need Help??

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

Monks,
Which configuration module would you recommend and why?
Config::IniFiles Config::Simple Config::Auto
Thanks.

Replies are listed 'Best First'.
Re: Which configuration module?
by reneeb (Chaplain) on Oct 20, 2006 at 09:21 UTC
Re: Which configuration module?
by Molt (Chaplain) on Oct 20, 2006 at 10:10 UTC

    I personally use AppConfig, the main reasons being that I've never had any trouble with it (despite using it for some quite nasty configurations), and that many of the things I write use TT2 and since AppConfig's a dependancy of TT2 it's one less thing to need to roll-out to servers.

    It can also handle configs in both UNIX and Windows styles, which is occasionally useful.

Re: Which configuration module?
by jdtoronto (Prior) on Oct 20, 2006 at 13:30 UTC
    I use Config::Simple it works very well, except for the tied hash interface where it flattens the sections into a single hash which when dumped looks like:
    'newsletter.owner_p1_font' => [], 'newsletter.contact_font' => 'Helvetica', 'newsletter.owner_city' => 'Hamilton', 'system.debug' => '1', 'armtwo.username' => [], 'newsletter.contact_y' => '150',
    The tied method of Config::IniFiles is more intuitive.

    Config::Simple is pretty widely used and if you have a problem the developer is very responsive.

    jdtoronto

Re: Which configuration module?
by Fletch (Chancellor) on Oct 20, 2006 at 13:04 UTC

    While not strictly a "configuration module", YAML (or YAML::Syck) might be of use.

Re: Which configuration module?
by EvanK (Chaplain) on Oct 20, 2006 at 13:53 UTC
    It all depends on the complexity of what you're needing a configuration file for.

    If its something relatively simple, use Config::Simple. its a VERY quick and useful format of one-to-one name->value pairs that supports comments and INI-style sections (depending on how you configure your instance of it).

    if you need something more complex, I highly recommend Config::General. this has the added advantage of using a (more or less) Apache-style configuration format, and all its cool little uses: repeatable options, nested options, inclusion of other config files, and more. this all comes at a slight performance cost as opposed to Config::Simple, of course.

    __________
    Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
    - Terry Pratchett

Re: Which configuration module?
by philcrow (Priest) on Oct 20, 2006 at 13:12 UTC
    I like Config::General and I usually use it in the Gantry::Conf config framework which gives much flexibility while providing a single master conf file for everything on a server.

    Phil

Re: Which configuration module?
by fmerges (Chaplain) on Oct 20, 2006 at 13:36 UTC

    Hi,

    I use YAML and sometimes AppConfig.

    Regards,

    fmerges at irc.freenode.net
Re: Which configuration module?
by tilly (Archbishop) on Oct 20, 2006 at 17:59 UTC
    What do you want in a configuration module?

    See Re (tilly) 6: using strict and a config file for a fairly reasonable list of wants that I had at one point, which none of those modules provides. (For the record, I'm still happy with pure Perl configuration files.)

      Well, I second tilly's requirements in this post.

      My requirements to a configuration module are:
      1. Allow nested categories.
      2. Allow list values (e.g. users=tinkywinky,dipsy,lala,po).
      3. Warn on access attempt to undefined variables.
      I am unfamiliar with have these requirements are covered, but thanks to excellent response from the monks, I have a good starting point for finding the way.

      Thanks.

      Andreas
      --

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://579530]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2021-10-24 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (89 votes). Check out past polls.

    Notices?