Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 41753
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: bobtfish [...] bobtfish.net
Requestors: eskild [...] zerodogg.org
Cc: dam [...] modsoftsys.com
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Catalyst complains that an argument "isn't numeric in numeric eq (==)"
Date: Tue, 16 Dec 2008 14:04:57 +0100
To: bug-Catalyst [...] rt.cpan.org
From: Eskild Hustvedt <eskild [...] zerodogg.org>
Catalyst 5.7014 When using the test server catalyst will complain a lot like this: Argument "0,019022" isn't numeric in numeric eq (==) at /usr/share/perl5/Catalyst.pm line 1364. Argument "0,008011" isn't numeric in numeric eq (==) at /usr/share/perl5/Catalyst.pm line 1364. Argument "0,006365" isn't numeric in numeric eq (==) at /usr/share/perl5/Catalyst.pm line 1364. Argument "0,004394" isn't numeric in numeric eq (==) at /usr/share/perl5/Catalyst.pm line 1364. Argument "0,006583" isn't numeric in numeric eq (==) at /usr/share/perl5/Catalyst.pm line 1364. Argument "0,004566" isn't numeric in numeric eq (==) at /usr/share/perl5/Catalyst.pm line 1364. Argument "0,008730" isn't numeric in numeric eq (==) at /usr/share/perl5/Catalyst.pm line 1364. The sprintf on that line appears to be useless, and converts it to a invalid string instead of the floating point number it actually wants. The following patch fixed it for me: --- /usr/share/perl5/Catalyst.pm~ 2008-12-16 10:41:55.000000000 +0100 +++ /usr/share/perl5/Catalyst.pm 2008-12-16 10:31:14.000000000 +0100 @@ -1360,7 +1360,7 @@ } if ($c->use_stats) { - my $elapsed = sprintf '%f', $c->stats->elapsed; + my $elapsed = $c->stats->elapsed; my $av = $elapsed == 0 ? '??' : 1 / $elapsed; $c->log->info( "Request took ${elapsed}s ($av/s)\n" . $c->stats->report . "\n" ); -- Eskild Hustvedt (Zero_Dogg) eskild [AT] zerodogg [DOT] org () Please avoid sending me Word attachments /\ see http://www.gnu.org/philosophy/no-word-attachments.html ASCII Ribbon Campaign - Against HTML Mail, Proprietary Attachments
I don't see how the string doesn't get converted to a number automatically by perl (as the string is a valid number). I certainly don't see this warning. Can you give us some instructions to reproduce, and your perl -V please?
On Sun Jun 28 19:29:08 2009, BOBTFISH wrote: Show quoted text
> I don't see how the string doesn't get converted to a number > automatically by perl (as the string is a valid number). > > I certainly don't see this warning. > > Can you give us some instructions to reproduce, and your perl -V please?
This is reported as Debian bug #536479 (http://bugs.debian.org/836479) and Ubuntu bug #308508 (https://bugs.launchpad.net/ubuntu/+source/libcatalyst-perl/+bug/308508). It seems the problem appears when the current locale uses commas for decimal signs (i.e. 1,5 for 3/2 instead of 1.5). Example for such locale is de_DE. Reproduce with: $ LANG=de_DE perl -MPOSIX=setlocale,LC_ALL -we 'use locale; setlocale(LC_ALL, "de_DE"); printf("%f\n", sprintf("%f", 3/2))' Argument "1,500000" isn't numeric in printf at -e line 1. 1,000000 (requires that de_DE locale is available on the system) Thanks, dam Debian Perl Group
As shown by dam in his example, this is a core perl issue with debian's packages, and nothing whatsoever to do with Catalyst, therefore I'm resolving this bug. Cheers t0m
CC: eskild [...] zerodogg.org,dam [...] modsoftsys.com
Subject: Re: [rt.cpan.org #41753] Catalyst complains that an argument "isn't numeric in numeric eq (==)"
Date: Wed, 12 Aug 2009 09:49:41 -0300
To: bug-Catalyst-Runtime [...] rt.cpan.org
From: David Bremner <bremner [...] unb.ca>
I have the same results as dam when I run the test on CentOS. ,---- | [ 10 gaea ~ ] cat /etc/issue | CentOS release 5.3 (Final) | Kernel \r on an \m | | [ 11 gaea ~ ] env LANG=de_DE perl -MPOSIX=setlocale,LC_ALL -we 'use locale;setlocale(LC_ALL, "de_DE"); printf("%f\n", sprintf("%f", 3/2))' | Argument "1,500000" isn't numeric in printf at -e line 1. `---- So I guess this is not a Debian specific issue. All the best, David