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