Subject: | [59152] UTF-8 (and other Unicode encodings?) BOM cause the package to fail |
Date: | Sat, 9 Jan 2016 12:40:31 +0200 |
To: | bug-Config-IniFiles [...] rt.cpan.org, Shlomi Fish <shlomif [...] shlomifish.org> |
From: | Meir Guttman <mguttman4 [...] gmail.com> |
On a private exchange with Shlomi Fish, the prodigious maintainer of this
and 100+ more packages, he challenged me to reopen this issue. (To my
defense I can tell you that as long as I kept my INI files BOM-free, I had
no trouble whatsoever using this module. In fact, no application of mine is
without it!)
OK, I tried his test program as well as my own small test program, and all
indeed tolerated the BOM without failure.But still, my application didn't!
Then I took one of my apps and started to trim it from below. It failed all
the way up, until the very act of calling the package's 'new' method:
*my $node_cfg = Config::IniFiles->new( -file => $node_ini_fn) or do { my
$err_message = join("\n", @Config::IniFiles::errors); die "Node INI file
problems: $err_message\n";};my $node_root =
$node_cfg->val('general','node_root');say "Node root: ", $node_root;*
Then it worked!!! The very same code that failed was now working!
Puzzling! How come that code *after* opening and reading the file was
causing a reading error???
Can anyone suggest a way to pin down the source of this?
Regards
Meir