Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 17017
Status: resolved
Priority: 0/
Queue: POE

People
Owner: Nobody in particular
Requestors: lars [...] thegler.dk
Cc:
AdminCc:

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



Subject: [PATCH] Protect against division by zero in POE::Resource::Statistics
In lib/POE/Resource/Statistics.pm, there is a few lines, that suggest protection against division by zero, but the actual code only offers half protection, giving rise to spurious 'Illegal division by zero at lib/POE/Resource/Statistics.pm line 67' errors during tests. This patch fixes the protection. --cut-- $ diff -ru POE-0.33-orig/lib/POE/Resource/Statistics.pm POE-0.33/lib/POE/Resource/Statistics.pm --- POE-0.33-orig/lib/POE/Resource/Statistics.pm 2005-05-15 09:00:12.000000000 +0200 +++ POE-0.33/lib/POE/Resource/Statistics.pm 2006-01-11 10:48:38.000000000 +0100 @@ -61,7 +61,7 @@ } # Division by zero sucks. - $average{blocked} ||= 0; + $average{interval} ||= 1; $average{user_events} ||= 1; POE::Kernel::_warn( --cut-- Enjoy! /Lars
Patch applied as revision 1911. Thank you.