Subject: | Locale-specific errors (FreeBSD, perl 5.20.x) |
http://fast-matrix.cpantesters.org/?dist=Org-Parser%200.51 shows that test errors may happen on freebsd systems, and only with perl 5.20.x. The test failures look like this:
...
# Failed test 'Org/Document.pm loaded ok'
# at t/00-compile.t line 60.
# got: '65280'
# expected: '0'
Unknown warnings category 'locale' at /usr/local/src/CPAN/build/2016110612/Org-Parser-0.51-0/blib/lib/Org/Document.pm line 11.
BEGIN failed--compilation aborted at /usr/local/src/CPAN/build/2016110612/Org-Parser-0.51-0/blib/lib/Org/Document.pm line 11.
Compilation failed in require at -e line 1.
...
The problem can be reduced to the following oneliner:
$ env LC_ALL=de_DE.UTF-8 perl5.20.3 -e 'use locale; no if $] ge 5.021_006, warnings => "locale";'
Unknown warnings category 'locale' at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
This does not happen on linux systems, regardless of locale, or on this system with a C locale, or with newer or older perls.
The problem seems to be the usage of "ge", together with locale switched on. Probably it's better to use ">=" here, or alternatively swap the "use locale" and "no if ..." lines.