Subject: | Documentation doesn't match behavior |
1) CAVEATS says "Config::Tiny" will only recognize the first time an option is set in a
config file. Any further attempts to set the same option later in the
config file are ignored."
This is incorrect. The last value seen will be used. See below.
2) FAQ says "Why can't I put comments at the ends of lines?"
In fact, comments of the form \s;\s.+ are removed
See "# Remove inline comments." in read_string() and test case below
#2 is annoying in that one can not have a property with a value ' ; something'.
For #1, it suffices to fix the documentation.
For #2, I recommend changing the code. Either remove the 'inline comment' feature, or make it conditional.
In the following example:
1) foo ends up with the value 'bar2', not 'bar1' as the POD claims
2) foo2's value does not include ' ; rem'
perl -MData::Dumper -MConfig::Tiny -e"\$cfg=Config::Tiny->read_string(
'foo=bar1
foo=bar2
foo2=barbar ; rem'); print Dumper(\$cfg)"
$VAR1 = bless( {
'_' => {
'foo' => 'bar2',
'foo2' => 'barbar'
}
}, 'Config::Tiny' );