Skip Menu |

This queue is for tickets about the Graphics-ColorObject CPAN distribution.

Report information
The Basics
Id: 65700
Status: open
Priority: 0/
Queue: Graphics-ColorObject

People
Owner: Nobody in particular
Requestors: dom [...] cpan.org
Cc:
AdminCc:

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



Subject: Use of uninitialized value within @_ in lc with perl 5.12
Perl 5.12.0 (currently in experimental) adds new uninitialized value warnings for the lc* and uc* functions. One of these gets triggered by Graphics::ColorObject: $ perl -MGraphics::ColorObject -we 'Graphics::ColorObject->new_RGBhex("#ff0000")' Use of uninitialized value within @_ in lc at /usr/share/perl5/Graphics/ColorObject.pm line 1905.
On Sun Feb 13 13:36:29 2011, DOM wrote: Show quoted text
> Perl 5.12.0 (currently in experimental) adds new uninitialized value > warnings for the lc* and uc* functions. One of these gets triggered by > Graphics::ColorObject: > > $ perl -MGraphics::ColorObject -we > 'Graphics::ColorObject->new_RGBhex("#ff0000")' > Use of uninitialized value within @_ in lc at > /usr/share/perl5/Graphics/ColorObject.pm line 1905.
BTW, ignore the "currently in experimental"; that was copied in error from the Debian bug report (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578938) and wasn't meant to make sense in the rt.cpan.org context. Thanks, Dominic.
I got this as well. Fixed it like this: root@deuce:~/.cpan/build/Graphics-ColorObject-0.5.0-2vvYZB# diff -u ColorObject.pm `perldoc -l Graphics::ColorObject` --- ColorObject.pm 2005-10-12 15:59:36.000000000 -0700 +++ /usr/local/share/perl/5.14.2/Graphics/ColorObject.pm 2015-03-29 13:56:09.000000000 -0700 @@ -147,13 +147,15 @@ my $this = +{}; bless $this, $pkgname; - my $col = &Graphics::ColorObject::namecolor($opts[0]); - if ($col) - { - shift(@opts); - $this = new_RGB($pkgname, $col, @opts); - return $this; - } + if (@opts) { + my $col = &Graphics::ColorObject::namecolor($opts[0]); + if ($col) + { + shift(@opts); + $this = new_RGB($pkgname, $col, @opts); + return $this; + } + } # check before converting to hash, even if the extra args are bogus at least it won't generate an error if (scalar(@opts) % 2 == 0)