Subject: | Don't fail if config files are missing |
foreach my $file_tested ( @{$files_ref} ) {
if ( ! exists $raw_cfany->{$file_tested} ) {
die qq{Specified configfile '$file_tested' does not exist, }
.
q{is empty, or is not readable};
}
This is a little harsh. I specify a list of possible config locations,
and the program dies if any one of them is not found?
Also, the order of specific-ness is effectively backwards compared to
what I expected. I expected, when passing a list of config file
locations, that the *first* would win, and any others would not be read.
eg
foreach my $file_tested ( reverse @{$files_ref} ) {
if ( ! exists $raw_cfany->{$file_tested} ) {
next;
}
my $cfany_hash = $raw_cfany->{$file_tested};
die "configfile must represent a hash structure in file:
$file_tested"
unless $cfany_hash && ref $cfany_hash && ref $cfany_hash eq
'HASH';
%raw_config = ( %raw_config, %{$cfany_hash} );
}