You need to read Proposed functionality before considering this page. The intention is to:
For example: Config::Loader->new( "/path/to/some/config/file" ) How is Config::Loader supposed to know how to load that file? Is it Config::General, JSON, YAML? A CSN would be something like this: Config::Loader->new( "config-general:/path/to/some/config/file") If the file has a reasonable extension, .cnf, .conf, .yml, .yaml, etc. I think Config::Loader should be able to guess it. But the scheme given at the head of the CSN should override it. If it can't guess, then it's a fatal error. A list or array ref containing scalars would load each dir (recursively) or file and merge them into a single hash, with the path name (including directory names and file name) as the insertion point into a hash, as Config::Merge does now. If you wanted to override default behaviour, you would pass in a hash ref. my $c = Config::Loader->new({ add_loaders => { 'conf' => 'Config::Loader::YAML' }, load_level => 'top', sources => [ $file_1, $file_2 ] }); Default options could be specified at the top level, but could be overriden with more specific parameters below that (javascript prototype style) : my $c = Config::Loader->new({ add_loaders => { 'conf' => 'Config::Loader::YAML' }, load_level => 'top', sources => [ $file_1, { load_level => 'file', source => $file_2 post_process => \&code_ref, } ] }); If we consider multiple CSNs as above, they could issue either as strings, or as hashes: Config::Loader->new([ "config-general:/path/to/some/config/file", { type => 'YAML', file => '/some/other/file', precedence => -1, }, ... ]) Detailed interface discussion: |