Skip Menu |

This queue is for tickets about the Error CPAN distribution.

Report information
The Basics
Id: 50573
Status: rejected
Priority: 0/
Queue: Error

People
Owner: SHLOMIF [...] cpan.org
Requestors: ether [...] cpan.org
Cc: karene [...] airg.com
nigelg [...] airg.com
AdminCc:

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



CC: nigelg [...] airg.com,karene [...] airg.com
Summary: "use strict; use warnings;" are missing in Error.pm after switching namespaces to Error::Simple, which mask the warning I describe below. The problem occurs when one passes no arguments to Error::Simple->new(). The warning that occurs is: Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/Error.pm line 280. This line is: my $text = "" . shift; ---- The warning was originally encountered on a redhat box running perl5.8.5 and Error 0.17015. In perl5.8.8 there is no warning unless I add "use strict; use warnings;" above the constructor's declaration. However we all know that strict checking is highly recommended, as it can reveal problems that otherwise would remain silent. I would suggest changing line 280 to: my $text = "" . (shift || ""); --- credit goes to Nigel Gregoire (nigelg@airg.com) for finding this.
Subject: use strict / use warnings throws an exception.
RT-Send-CC: nigelg [...] airg.com, bitcard [...] froods.org
Hi! On Fri Oct 16 15:41:33 2009, bitcard@froods.org wrote: Show quoted text
> Summary: "use strict; use warnings;" are missing in Error.pm after > switching namespaces to Error::Simple, which mask the warning I describe > below. > > The problem occurs when one passes no arguments to Error::Simple->new(). > The warning that occurs is: > Use of uninitialized value in concatenation (.) or string at > /usr/lib/perl5/site_perl/5.8.8/Error.pm line 280. > > This line is: my $text = "" . shift; > > ---- > The warning was originally encountered on a redhat box running perl5.8.5 > and Error 0.17015. In perl5.8.8 there is no warning unless I add "use > strict; use warnings;" above the constructor's declaration. However we > all know that strict checking is highly recommended, as it can reveal > problems that otherwise would remain silent. I would suggest changing > line 280 to: > > my $text = "" . (shift || ""); >
It is unclear from your description what exactly is the problem. Can you provide a small testcase (a self-contained script) which demonstrates the problem? Regards, -- Shlomi Fish Show quoted text
> --- > credit goes to Nigel Gregoire (nigelg@airg.com) for finding this.
Resolving as the original reporter hasn't responded to our query for essential information in over a month.
Subject: Please reopen
From: bitcard [...] froods.org
On Thu Feb 04 05:49:54 2010, SHLOMIF wrote: Show quoted text
> Resolving as the original reporter hasn't responded to our query for > essential information in over a month.
Please reopen (if this reply did not do so automatically).. Apologies, your replies got lost in my spam folder :( Repro steps (line numbers are for version 0.17016) 1. Edit Error.pm and add "use strict; use warnings;" on line 259 (just after "package Error::Simple;" 2. run: perl -MError -we'Error::Simple->new();' Observe the warning: Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.8/Error.pm line 264. This is because of the line: 264: my $text = "" . shift;
On Thu Feb 04 17:17:13 2010, bitcard@froods.org wrote: Show quoted text
> On Thu Feb 04 05:49:54 2010, SHLOMIF wrote:
> > Resolving as the original reporter hasn't responded to our query for > > essential information in over a month.
> > Please reopen (if this reply did not do so automatically).. > Apologies, your replies got lost in my spam folder :(
OK. Please make sure to whitelist them. Show quoted text
> > Repro steps (line numbers are for version 0.17016) > 1. Edit Error.pm and add "use strict; use warnings;" on line 259 (just > after "package Error::Simple;" > 2. run: perl -MError -we'Error::Simple->new();' > > Observe the warning: > Use of uninitialized value in concatenation (.) or string at > /usr/lib/perl5/site_perl/5.8.8/Error.pm line 264. > > This is because of the line: > 264: my $text = "" . shift; >
OK, I see it now. However, this warning is in place because the Error::Simple contract (see http://search.cpan.org/dist/Error/lib/Error/Simple.pm ) specifically says that Error::Simple accepts one compulsory text variable - «Error::Simple->new($text [, $value])». If you don't specify it - it's your problem. Can I close it now? Regards, -- Shlomi Fish
Subject: Re: [rt.cpan.org #50573]
Date: Mon, 8 Feb 2010 17:17:56 -0800
To: Shlomi Fish via RT <bug-Error [...] rt.cpan.org>
From: Karen Etheridge <bitcard [...] froods.org>
On Fri, Feb 05, 2010 at 04:13:05AM -0500, Shlomi Fish via RT wrote: Show quoted text
> OK, I see it now. However, this warning is in place because the > Error::Simple contract (see > http://search.cpan.org/dist/Error/lib/Error/Simple.pm ) specifically > says that Error::Simple accepts one compulsory text variable - > «Error::Simple->new($text [, $value])». If you don't specify it - it's > your problem. > > Can I close it now?
Yes. --Ether
Closing.