Subject: | Config::Any - Compliments, and feature requests |
First of all, this module attempts to fill a gap that I myself have run
across several times, so bravo for taking a good stab at it. I do have
a couple of feature requests, though.
It would be handy to be able to specify which plugin to use for given
file(s), without it having to "guess".
# config file ends with '.conf', but is in-fact an ini file
my $cfg = Config::Any->load_files({files => ['myconfig.conf'],
use_plugin => 'ini' });
I also found that though Config::Any uses Config::Tiny for INI parsing,
it does some additional post-processing that "breaks up" INI sections
that would normally not be modified. Specifically, it splits up and
nests sections that have whitespace in them. For example:
[Section Alpha]
Key Number One = Value Number One
Key Number Two = Value Number Two
[default]
Key Number Three = Value Number Three
Key Number Four = Value Number Four
The above INI file generates this through Config::Any, breaking up the
section called 'Section Alpha'
{
'Section' => {
'Alpha' => {
'Key Number Two' => 'Value Number Two',
'Key Number One' => 'Value Number One'
}
},
'default' => {
'Key Number Four' => 'Value Number Four',
'Key Number Three' => 'Value Number Three'
}
}
While this may indeed be suitable in some cases, it may not in many.
Perhaps this could be specified by a plugin-specific switch?
# allow spaces in section names, thus NOT breaking them apart on whitespace
my $cfg = Config::Any->load_files({files => ['foobar.ini'], ini_space =>
1 });
# this would give us:
{
'Section Alpha' => {
'Key Number Two' => 'Value Number Two',
'Key Number One' => 'Value Number One'
},
'default' => {
'Key Number Four' => 'Value Number Four',
'Key Number Three' => 'Value Number Three'
}
}
At any rate, this is a fantastic module and has saved me loads of work.
Thanks!
-Evan Kaufman