develooper Front page | perl.perl5.porters | Postings from July 2014

Re: [perl #122105] Invalid version format (non-numeric data) at /usr/share/perl5/core_perl/File/ line 10.

Thread Previous | Thread Next
Kevin Ryde
July 1, 2014 05:25
Re: [perl #122105] Invalid version format (non-numeric data) at /usr/share/perl5/core_perl/File/ line 10.
Message ID:
Karl Williamson <> writes:
> shows 20 modules that do this, most of them authored by Kevin Ryde.

I can't remember what went wrong that I put disable_setlocale().  It was
probably version numbers suffering under "," for decimal point, but I
don't know if this was due to modules with strings $VERSION="1.23"
instead of numbers, or something of

> In order to
> prevent needless setting and resetting of the locale, Perl keeps track
> of what it thinks it is set to.

You could probably ask xs code to announce when it has changed or might
have changed the locale.  A locale change should be unusual so only a
few things would be affected.  That's the new_numeric() in POSIX.xs
setlocale() already is it?  A spot of ppport.h could no doubt let it do
something on all perls.

I wonder that if the perl startups have already set the locale sensibly
then the default in perl-gtk and wxperl ought to be to leave the locale
alone.  I suppose that means LC_NUMERIC is not localized, but perhaps
anything except LC_NUMERIC=C usually causes too much trouble to perl.

In some of my charting code I think I applied an LC_NUMERIC to get the
locale decimal into a Number::Format but then put it back to
LC_NUMERIC=C for running.  The Number::Format is then for user display,
and ordinary "C" decimal point for arithmetic.  (I may have even
proposed a function in Number::Format which would give a formatter
object with locale-ized settings.)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About