Config::Simple::Inherit

NAME
Config::Simple::Inherit - Inherit values from, overwrite a base configuration

VERSION
Version 0.01

SYNOPSIS
my $installation_cfg = Config::Simple->new( file =>
'/etc/app_name/app_name.ini' );

my $client_cfg = Config::Simple::Inherit->inherit( base_config =>
$installation_cfg, filename => '/etc/app_name/client_name/app_name.ini',
);

my $job_cfg = Config::Simple::Inherit->inherit( base_config =>
$client_cfg, filename => '/etc/app_name/client_name/app_job_id.ini', );

METHODS
->inherit()
This module only offers this one method, but I trust you'll find it useful. It returns a Config::Simple object, when given a reference to a hash, of which it only recognizes two keys: 'base_config' and 'filename'. The 'base_config' ought to be left undefined or set to a 'Config::Simple' object created with either this method or the ->new() method provided by Config::Simple. When 'base_config' is given a Config::Simple object, it walks every configuration parameter defined in the filename, and uses the new value to update the value for the respective parameterin the 'base_config' object, inheriting values from it, but overloading the configuration with the new values.

I envision essentially two ways this module might be used:

(1) to provide a means for getting more specific with a configuration by first creating an installation-wide configuration, then a client specific configuration, then job specific configuration, each overloading the more general values provided by the configuration before it.

(2) to enforce client, and installation security controls and sanity checks on a configuration prepared by an untrusted user. Say you had an application which permitted a local user to create a configuration file for a job. By loading the user created configuration first, then using the installation default configuration to overwrite it, it would be possible to prevent abuse and enforce system wide constraints.

AUTHOR
Hugh Esco, ""

BUGS
Please report any bugs or feature requests to "bug-config-simple-inherit
at rt.cpan.org", or through the web interface at
.
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT
You can find documentation for this module with the perldoc command.

perldoc Config::Simple::Inherit

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

* CPAN Ratings

* RT: CPAN's request tracker

* Search CPAN

ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2008 Hugh Esco, all rights reserved.

This program is released under the following license: gpl

SEE ALSO
Config::Simple.