Subject: | Config::IniFiles with handle_trailing_comment doesn't parse trailing comments correctly |
Date: | Tue, 16 Jun 2015 07:59:30 +0000 |
To: | "bug-Config-IniFiles [...] rt.cpan.org" <bug-Config-IniFiles [...] rt.cpan.org> |
From: | Rohan Carly <rohan [...] digins.net.au> |
Dear maintainer,
When I insert a comment containing a semicolon into an INI file, I was surprised to see only half of it being treated as a comment, with the reset being treated as part of the parameter value.
Here is my test code:
#!/usr/bin/env perl
use Config::IniFiles;
use warnings;
my $ini_file_contents = "[abc]\ndog=cat ; a comment ; further comment";
my $c = Config::IniFiles->new(
-file=>\$ini_file_contents,
-handle_trailing_comment=>1
);
print $c->val("abc","dog")."\n”;
Expected output: cat
Actual output: cat ; a comment
I tried this with version 2.86.
I was hoping that you might be able to correct this behaviour. I note that some other INI file parsers, such as crudini (command line util), provide the result I expect.
Thanks,
--
Rohan Carly