This is the README file for AppConfig Version 1.54 AppConfig is a bundle of Perl5 modules for reading configuration files and parsing command line arguments. This is a descendant of, and supercedes the App::Config module. Functionality is extended over the final version of App::Config (1.09) and includes many new features. This module has been developed and in the process, renamed, as part of an effort to unify the various Perl modules for parsing configuration files and command line arguments. AppConfig has a powerful but easy to use module for parsing configuration files. It also has a simple and efficient module for parsing command line arguments. For fully-featured command line parsing, a module is provided for interfacing AppConfig to Johan Vromans' extensive Getopt::Long module. Johan will continue to develop the functionality of this package and its features will automatically become available through AppConfig. All of the modules and features of the AppConfig bundle are easily accessible through the AppConfig.pm module. Relevant changes to the AppConfig module are documented in the Changes files. The rest of this document contains information extracted from relevant sections of the AppConfig.pm documentation. NAME AppConfig - application configuration files via command line, config file, etc. OVERVIEW AppConfig is a Perl5 module for managing application configuration information. It maintains the state of any number of variables and provides methods for parsing configuration files and command line arguments. Variables values may be set via configuration files. Variables may be flags (On/Off), take a single value, or take multiple values stored as a a list or hash. The number of arguments a variable expects is determined by its configuration when defined. # flags verbose nohelp debug = On # single value home = /home/abw/ # multiple list value file = /tmp/file1 file = /tmp/file2 # multiple hash value book camel = Programming Perl book llama = Learning Perl The '-' prefix can be used to reset a variable to its default value and the '+' prefix can be used to set it to 1 -verbose +debug Variable, environment variable and tilde (home directory) expansions can be applied (selectively, if necessary) to the values read from configuration files: home = ~ # home directory nntp = ${NNTPSERVER} # environment variable html = $home/html # internal variables img = $html/images Configuration files may be arranged in blocks as per the style of Win32 "INI" files. [file] site = kfs src = ~/websrc/docs/$site lib = ~/websrc/lib dest = ~/public_html/$site [page] header = $lib/header footer = $lib/footer Variables may also be set by parsing command line arguments. myapp -verbose -site kfs -file f1 -file f2 AppConfig provides a simple method (args()) for parsing command line arguments. A second method (getopt()) allows more complex argument processing by delegation to Johan Vroman's Getopt::Long module. PREREQUISITES AppConfig requires Perl 5.005 or later. The Getopt::Long and Test::More modules should be installed. If you are using a recent version of Perl (e.g. 5.8.0) then these should already be installed. OBTAINING AND INSTALLING THE AppConfig MODULE BUNDLE The AppConfig module bundle is available from CPAN. As the 'perlmod' manual page explains: CPAN stands for the Comprehensive Perl Archive Network. This is a globally replicated collection of all known Perl materials, including hundreds of unbundled modules. [...] For an up-to-date listing of CPAN sites, see http://www.perl.com/perl/ or ftp://ftp.perl.com/perl/ . Within the CPAN archive, AppConfig is in the category: 12) Option, Argument, Parameter and Configuration File Processing The module is available in the following directories: /modules/by-module/AppConfig/AppConfig-.tar.gz /authors/id/ABW/AppConfig-.tar.gz AppConfig is distributed as a single gzipped tar archive file: AppConfig-.tar.gz Note that "" represents the current AppConfig version number, of the form "n.nn", e.g. "3.14". See the REVISION section below to determine the current version number for AppConfig. Unpack the archive to create a AppConfig installation directory: gunzip AppConfig-.tar.gz tar xvf AppConfig-.tar 'cd' into that directory, make, test and install the modules: cd AppConfig- perl Makefile.PL make make test make install The 't' sub-directory contains a number of test scripts that are run when a 'make test' is run. The 'make install' will install the module on your system. You may need administrator privileges to perform this task. If you install the module in a local directory (for example, by executing "perl Makefile.PL LIB=~/lib" in the above - see "perldoc MakeMaker" for full details), you will need to ensure that the PERL5LIB environment variable is set to include the location, or add a line to your scripts explicitly naming the library location: use lib '/local/path/to/lib'; The 'examples' sub-directory contains some simple examples of using the AppConfig modules. AUTHOR Andy Wardley, VERSION This is version 1.54. COPYRIGHT Copyright (C) 1997-2003 Andy Wardley. All Rights Reserved. Copyright (C) 1997,1998 Canon Research Centre Europe Ltd. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO AppConfig::State, AppConfig::File, AppConfig::Args, AppConfig::Getopt Getopt::Long