Config-Tree
Config::Tree lets you access your various configuration (Perl data structure, config files, config dirs, environment variables, command line options, even databases) as a single tree using a Unix filesystem-like interface.
There are already a lot of config-related modules on CPAN. Here's the main highlights of this module:
Things that are like what other modules do:
Things that are unlike what many other modules do:
Simple usage example:
# in /etc/myapp.yaml:
# in ~/.myapp.yaml:
# in myapp.pl:
use Config::Tree;
my $conf = get_config();
printf "/foo/bar = %s\n", $conf->get('/foo/bar');
$conf->cd('/foo');
printf "/foo/baz = %s\n", $conf->get('baz');
printf "/quux = %s\n", $conf->get('../quux');
# in shell:
% perl myapp.pl --quux=5
/foo/bar = 3
/foo/baz = 2
/quux = 5
See Config::Tree::Multi for more detailed usage information. You can customize the location of files/dirs, etc.
INSTALLATION
To install this module, run the following commands:
perl Makefile.PL
make
make test
make install
SUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the perldoc command.
perldoc Config-Tree
You can also look for information at:
RT, CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Config-Tree
AnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/Config-Tree
CPAN Ratings
http://cpanratings.perl.org/d/Config-Tree
Search CPAN
http://search.cpan.org/dist/Config-Tree/
COPYRIGHT AND LICENCE
Copyright (C) 2009 Steven Haryanto
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.