Subject: | Config::Any::Ini sections with normal key/values and subsections is broken |
Hi,
Consider :
[section1]
some = option
[section1 subsection1]
some = option
[section1 subsection2]
some = option
If you are unlucky (i.e. always, following Murphy's Law), the loop on the hash keys of the
$config object will be done in this order : 'section1 subsection1', 'section1', 'section1
subsection2'.
This will give this structure :
section1 => {
some = option,
subsection2 => {
some => option
}
}
Where is subsection1 ? it has been erased by this line :
$out->{ $k } = $ref;
Here is the patch to fix it :
--- INI.pm.old 2008-01-28 14:00:05.000000000 +0700
+++ INI.pm 2008-01-28 13:59:42.000000000 +0700
@@ -59,7 +59,7 @@
$out->{ $a }->{ $b } = $ref;
}
else {
- $out->{ $k } = $ref;
+ $out->{ $k } = { %{$out->{ $k }}, %$ref };
}
}
return $out;
Cheers,
dams