This is PerlMonks "Mobile"

Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Item Description: The Swiss Army Knife of Config Param modules

Review Synopsis:

++

Extremely flexible handling of both configuration files, and commandline parameters.

Four parameter types - boolean, scalar, array and hash.

As each parameter is defined it can have various properties set, including DEFAULT setting, ACTION to take on use, VALIDATE based on regex or sub result, various types of variable EXPANDing, variable name ALIASes.

The properties DEFAULT, ACTION, VALIDATE, and EXPAND can be set globally as well as local to a parameter.

Can handle multiple sources of configuration file, including filehandles.

--

VALIDATEs which use a sub don't appear to trigger the return of a false value from the arg() method, although a warning to the user is printed.

ACTIONs cannot alter the value they're attached to, as this sets up a circular reference.

Overall

An extremely useful module which, although it takes a bit of time to get to know, is well worth the extra effort.

Replies are listed 'Best First'.
Re: AppConfig
by belg4mit (Prior) on Jun 16, 2002 at 01:57 UTC
    You neglect to mention the documentation, which, to put it mildly, is severly lacking.

    From what I can make out the interface also seems to be a little umm interesting. Namely having undefined methods default to getting a variable of the same name. This results in an inconsistent interface for fetching variables of the same name as an existing method...

    UPDATE: While trying to figure out how to use this module I came across this IBM tutorial.

    --
    perl -pew "s/\b;([mnst])/'$1/g"

      UPDATE: While trying to figure out how to use this module I came across this IBM tutorial.

      Outstanding follow-up with the reference, belg4mit++. Indeed, the documentation with the AppConfig module is a hard read. I fought it for several hours recently and it was an irritating experience.

          Soren/Intrepid

      -- 
      use PerlMonk::Tye qw(:wisely);
      

        Indeed, the documentation with the AppConfig module is a hard read.

        Maybe it's gotten better since then, but I haven't had any trouble with AppConfig's docs.
Re: AppConfig
by educated_foo (Vicar) on May 06, 2002 at 04:20 UTC
    For another delicious(ly full-featured) config option, you might try Resources. It's got more the flavor of X resources, with defaulting, inheritance, etc.

    /s

Re: AppConfig
by chicks (Scribe) on Aug 31, 2004 at 22:08 UTC
    Has anybody managed to come up with a way to use AppConfig's configuration to produce a usage message? Some sort of "here are the options and these are the defaults sort of thing".