Subject: | missing or bad config files listed in $args->{files} wipes the merged config hash |
If a file listed in $args->{files} is not processed by Config::Any for
any reason (meaning it has no key in the $config_any returned by
SUPER::_load), the merge function will wipe all the config information
that comes before it when merging. A simple grep filter on existant keys
avoids this:
@@ -28,7 +28,7 @@
my $config_any = $class->SUPER::_load($args);
- foreach my $file (@{$args->{files}}) {
+ foreach my $file ( grep { exists $config_any->{$_} }
@{$args->{files}}) {
$config_merged = merge($config_merged,
$config_any->{$file});
#while (my ($key,$val) = each %{$config_any->{$file}}) {
#$config_merged{$key} = $val;