Skip Menu |

This queue is for tickets about the Number-Format CPAN distribution.

Report information
The Basics
Id: 48038
Status: resolved
Priority: 0/
Queue: Number-Format

People
Owner: Nobody in particular
Requestors: dianne [...] wellsgaming.com
Cc: ANSGAR [...] cpan.org
AdminCc:

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



Subject: Error showing on log files
Date: Mon, 20 Jul 2009 15:54:59 -0700
To: bug-Number-Format [...] rt.cpan.org
From: Dianne Yumul <dianne [...] wellsgaming.com>
After install perl-Number-Format-1.72a on CentOS 5.3, I get the following error on the logs: Use of uninitialized value in numeric comparison (<=>) at /usr/lib/ perl5/vendor_perl/5.8.8/Number/Format.pm line 539. Thank you.
Subject: Re: [rt.cpan.org #48038] Error showing on log files
Date: Fri, 25 Sep 2009 16:40:52 -0700
To: bug-Number-Format [...] rt.cpan.org
From: Bill Ward <bill [...] wards.net>
I think that would only happen if you call format_number() with an undefined value as $number. I guess I should default to 0 in that case? On Mon, Jul 20, 2009 at 3:55 PM, Dianne Yumul via RT <bug-Number-Format@rt.cpan.org> wrote: Show quoted text
> Mon Jul 20 18:55:33 2009: Request 48038 was acted upon. > Transaction: Ticket created by dianne@wellsgaming.com >       Queue: Number-Format >     Subject: Error showing on log files >   Broken in: (no value) >    Severity: (no value) >       Owner: Nobody >  Requestors: dianne@wellsgaming.com >      Status: new >  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=48038 > > > > After install perl-Number-Format-1.72a on CentOS 5.3, I get the > following error on the logs: > > Use of uninitialized value in numeric comparison (<=>) at /usr/lib/ > perl5/vendor_perl/5.8.8/Number/Format.pm line 539. > > Thank you. > > > >
-- Check out my LEGO blog at http://www.brickpile.com/ View my photos at http://flickr.com/photos/billward/ Follow me at http://twitter.com/williamward
Hi, On Fri Sep 25 19:41:13 2009, bill@wards.net wrote: Show quoted text
> I think that would only happen if you call format_number() with an > undefined value as $number. I guess I should default to 0 in that > case?
I just saw a suggested patch on Ubuntu's bug tracker [1] which does that. However I haven't looked at this issue any further myself. Regards, Ansgar [1] <https://bugs.launchpad.net/bugs/613460>
Subject: Re: [rt.cpan.org #48038] Error showing on log files
Date: Thu, 5 Aug 2010 12:13:57 -0700
To: bug-Number-Format [...] rt.cpan.org
From: Dianne Yumul <dianne [...] wellsgaming.com>
On Aug 4, 2010, at 5:49 PM, Ansgar Burchardt via RT wrote: Show quoted text
> I just saw a suggested patch on Ubuntu's bug tracker [1] which does that. > However I haven't looked at this issue any further myself. > > Regards, > Ansgar > > [1] <https://bugs.launchpad.net/bugs/613460>
The patch works. Actually, the line numbers were a little off so built our own patch and the error is gone. You just need to add the line in Format.pm inside format_number and format_price. Thanks, Dianne
It shouldn't just treat the value as a 0. It's always wrong to pass undef to Number::Format methods. I am willing to add a test that generates a more helpful warning but not to silently ignore undef values.
This patch will prevent the warnings for the methods affected, but all Number::Format methods are susceptible to something similar. The calling code should check to see if the value is undef before trying to call Number::Format methods.
On further investigation I find that I can use the bitmask from caller() to determine if the calling environment had warnings enabled for uninitialized values, and give or suppress a warning accordingly.
This will be fixed in 1.74