New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Version string '1,3' contains invalid data; [...]" warning when locale is set #9761
Comments
From @scfcThis is a bug report for perl from tim@tim-landscheidt.de, I started out with a warning: | Version string '1,3' contains invalid data; ignoring: ',3' at /usr/lib/perl5/5.10.0/i386-linux-thread-multi/IO/Socket.pm line 12. when using this script: | #!/usr/bin/perl -w | use strict; | use POSIX qw(locale_h); | setlocale (LC_CTYPE, 'german'); | use LWP::UserAgent; | my $ua = LWP::UserAgent->new () or die; Line 12 of | use Socket 1.3; I could narrow the warning down to: | #!/usr/bin/perl -w | use strict; | use POSIX qw(locale_h); | setlocale (LC_CTYPE, 'german'); | eval "use Socket 1.3;"; which gives: | Version string '1,3' contains invalid data; ignoring: ',3' at (eval 1) line 1. (The "eval" is important here; without it, there is no warn- Though only a warning, this obviously may break dependen- Flags: This perlbug was built using Perl 5.10.0 in the Fedora build system. Site configuration information for perl 5.10.0: Configured by Red Hat, Inc. at Tue Apr 14 07:23:09 EDT 2009. Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Locally applied patches: @INC for perl 5.10.0: Environment for perl 5.10.0: |
From p5p@spam.wizbit.beOn Wed Jun 03 02:46:44 2009, scfc wrote:
[snip]
It comes down to: #!/usr/bin/perl -l use strict; use POSIX qw(locale_h); setlocale (LC_CTYPE, 'german'); __END__ This will print 1,3 because the decimal point in Geman is a comma. Currently the only 'solution' I can think of is to use eval "use If eval "use Socket v1.3"; is used then the warning becomes: Best regards, Bram |
The RT System itself - Status changed from 'new' to 'open' |
From @JohnPeacockBram via RT wrote:
Yeah, that won't work; the magic that decides whether the value after the John |
From @JohnPeacockTim Landscheidt (via RT) wrote:
Until I can figure out why eval isn't respecting the locale(), you can work use Socket 1.3; at any point in your original script. The version-aware code in the core HTH John |
From p5p@perl.wizbit.beCiteren John Peacock <john.peacock@havurah-software.org>:
But it does work.
'1.3' looks like a number..
$ perl-5.10.0 -MSocket -wle 'print $Socket::VERSION;' #!/usr/bin/perl -l use strict; use POSIX qw(locale_h); setlocale (LC_CTYPE, 'german'); $ perl-5.10.0 rt-66244.pl Best regards, Bram |
From rob@themayfamily.me.uk2009/6/4 Bram <p5p@perl.wizbit.be>:
But isn't that because it's being handled by Exporter: if ($sym =~ m/^\d/) { Rob. |
From @gbarrOn Jun 4, 2009, at 6:31 AM, Bram wrote:
No, its not. That looks like a string to the parser. It is only a
But look where the error message comes from, Exporter compare these $ perl -e "use Socket 2.0" $ perl -e "use Socket '2.0'" notice the difference. In the first case the parser notices the number and will call Socket-
Using Exporter to check version was the original way to check it. But The parser uses looks_like_number to determine what todo with the
# calls Graham. |
From @JohnPeacockTransferring this to the version.pm queue for resolution: |
@iabyn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#66244 (status was 'rejected')
Searchable as RT66244$
The text was updated successfully, but these errors were encountered: