symkat > Config-Layered > Config::Layered::Source::ENV

Download:
Config-Layered-0.000003.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Config::Layered::Source::ENV - The Environment Variable Source

DESCRIPTION ^

The ENV source provides configuration through environment variables.

For each top-level key in the default data structure, it checks for the environment variable CONFIG_$KEY where $KEY is the name of the key used in the default data structure.

EXAMPLE ^

    my $config = Config::Layered->load_config( 
        default => {
            foo         => "bar",
            blee        => "baz",
            bax         => {
                chicken => "eggs",
            }
        }
    );

With the above configuration, the following keys will be checked:

The following would *NOT* be checked:

Given the above default data structure, a command run as CONFIG_FOO="Hello World" ./myprogram would result in a $config structure like this:

    {
        foo         => "Hello World",
        blee        => "baz",
        bax         => {
            chicken => "eggs",
    }

SOURCE ARGUMENTS ^

Example:

    Config::Layered->load_config(
        sources => [ 
            'ENV' => { prefix => "MYAPP", params => [qw( bar blee )] } 
        ],
        default => { debug => 0, verbose => 1 },
    );

The following keys would be checked:

syntax highlighting: