Config::Layered::Source::ConfigAny - The Configuration File Source
The ConfigAny source provices access to running ConfigAny on a given file stem.
my $config = Config::Layered->load_config( sources => [ 'ConfigAny' => { file => "/etc/myapp" } ], default => { foo => "bar", blee => "baz", bax => { chicken => "eggs", } } );
Provided a file /etc/myapp with the following content:
/etc/myapp
foo: this bax: chicken: no-eggs pork: chops
The following data structure in $config would be the result:
$config
{ foo => "this", blee => "baz", bax => { chicken => "no-eggs", pork => "chops", }
file is a string which will be passed to Config::Any as a file stem.
file is a string which will be passed to Config::Any as a file stem -- file as a source argument will take precedence.
To install Config::Layered, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Layered
CPAN shell
perl -MCPAN -e shell install Config::Layered
For more information on module installation, please visit the detailed CPAN module installation guide.