mirror of
https://codeberg.org/scip/Config-General.git
synced 2025-12-16 20:21:01 +01:00
- fixed bug in save(), now blocks containing whitespaces will be saved using quotes, in addition the parser observes the quoting feature, added portion about this to the pod doc. pointed out by Jeff Murphy <jcmurphy@jeffmurphy.org>. - added internal list of files opened so far to avoid reading in the same file multiple times. Suggested by Michael Graham. - added new method files() which returns the above list. - added workaround for foolish perl installation on debian systems (croak() doesn't work anymore as of 5.8.4, it's a shame!) - applied patch by Michael Graham which fixes IncludeRelative feature, now an included file is being included relative to the calling config file, not the first one. - added 'make test' targets for files() and include stuff. (by Michael too) git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@54 be1acefe-a474-0410-9a34-9b3221f2030f
108 lines
3.1 KiB
Plaintext
108 lines
3.1 KiB
Plaintext
NAME
|
|
Config::General - Generic Config Module
|
|
|
|
SYNOPSIS
|
|
use Config::General;
|
|
$conf = new Config::General(-ConfigFile => "myconfig.rc");
|
|
my %config = $conf->getall;
|
|
|
|
|
|
DESCRIPTION
|
|
This module opens a config file and parses it's contents
|
|
for you. After parsing the module returns a hash structure
|
|
which contains the representation of the config file.
|
|
|
|
The format of config files supported by Config::General is
|
|
inspired by the well known apache config format, in fact,
|
|
this module is 100% read-compatible to apache configs, but
|
|
you can also just use simple name/value pairs in your config
|
|
files.
|
|
|
|
In addition to the capabilities of a apache config file
|
|
it supports some enhancements such as here-documents, C-
|
|
style comments or multiline options. It is also possible to
|
|
save the config back to disk, which makes the module a
|
|
perfect backend for configuration interfaces.
|
|
|
|
It is possible to use variables in config files and there
|
|
exists also support for object oriented access to the
|
|
configuration.
|
|
|
|
|
|
INSTALLATION
|
|
|
|
to install, type:
|
|
perl Makefile.PL
|
|
make
|
|
make test
|
|
make install
|
|
|
|
to read the complete documentation, type:
|
|
perldoc Config::General
|
|
perldoc Config::General::Extended
|
|
perldoc Config::General::Interpolated
|
|
|
|
see some example config files which can
|
|
be parsed with Config::Genreal in the subdirectory
|
|
t/cfg.*
|
|
|
|
|
|
UPDATE
|
|
|
|
If you are updating from version 1.xx, you might be interested,
|
|
that some things in the API has changed, which might force you
|
|
to change your application code. These changes were necessary
|
|
to clean up the module interface. Now it has a consistent
|
|
"look and feel" and behaves more naturally. Therefore historic
|
|
remains were removed.
|
|
|
|
Here is a short list:
|
|
|
|
o it is no more possible to use Config::General::Extended
|
|
and Config::General::Interpolated directly. Instead use
|
|
Config::General and turn on -InterPolateVars and
|
|
-ExtendedAccess respectively.
|
|
|
|
o the method NoMultiOptions() is deprecated. Set the parameter
|
|
-AllowMultiOptions to false when calling new() to create
|
|
a new Config::General object.
|
|
|
|
o the method save() is deprecated. Use save_file() or
|
|
save_string() instead.
|
|
|
|
o the parameter -file is deprecated. Use -ConfigFile instead.
|
|
|
|
o the parameter -hash is deprecated. Use -ConfigHash instead.
|
|
|
|
For a more detailed explanation of changes refer to the Changelog.
|
|
|
|
|
|
COPYRIGHT
|
|
Config::General
|
|
Config::General::Extended
|
|
Copyright (c) 2000-2005 by Thomas Linden <tom@daemon.de>
|
|
|
|
Config::General::Interpolated
|
|
Copyright (c) 2001 by Wei-Hon Chen <plasmaball@pchome.com.tw>
|
|
Copyright (c) 2002-2005 by Thomas Linden <tom@daemon.de>.
|
|
|
|
This library is free software; you can redistribute it
|
|
and/or modify it under the same terms as Perl itself.
|
|
|
|
HOMEPAGE
|
|
|
|
The homepage of Config::General is located at:
|
|
|
|
http://www.daemon.de/config-general/
|
|
|
|
BUGS
|
|
make test does currently not catch all possible scenarios.
|
|
|
|
|
|
AUTHOR
|
|
Thomas Linden <tom@daemon.de>
|
|
|
|
|
|
VERSION
|
|
2.28
|