Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 56619
Status: resolved
Priority: 0/
Queue: Perl-Critic

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

Bug Information
Severity: Normal
Broken in: 1.105
Fixed in: 1.108



Subject: "die" used instead of "croak" (possibly false positive)
"die" used instead of "croak" at line 4, column 24. See page 283 of PBP. 1 #!/usr/bin/perl 2 use strict; 3 4 eval "use Pod::Man" or die "$!"
Subject: Re: [rt.cpan.org #56619] "die" used instead of "croak" (possibly false positive)
Date: Thu, 15 Apr 2010 07:55:21 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
On 4/15/10 3:53 AM, Jari Aalto via RT wrote: Show quoted text
> "die" used instead of "croak" at line 4, column 24. See page 283 of PBP. > > 1 #!/usr/bin/perl > 2 use strict; > 3 > 4 eval "use Pod::Man" or die "$!"
Certainly looks like a true positive to me.
On Thu Apr 15 08:55:39 2010, clonezone wrote: Show quoted text
> On 4/15/10 3:53 AM, Jari Aalto via RT wrote:
> > "die" used instead of "croak" at line 4, column 24. See page 283 of PBP. > > > > 1 #!/usr/bin/perl > > 2 use strict; > > 3 > > 4 eval "use Pod::Man" or die "$!"
> > Certainly looks like a true positive to me.
I quote from the POD from P::C::P::ErrorHandling::RequireCarping: =head1 BUGS This should not complain about using C<warn> or C<die> if it's not in a function, or if it's in C<main::>. A proposed fix, compatible with the above POD, was committed as SVN revision 3799. Note that a bunch of the tests got 'package' statements added, since 'die' is now OK in main::. Actually, thinking about the code I committed, I implemented 'not in a function _and_ in main::', not _or_. The Changes file and the commit comment document it this way. Elliot/Jeffrey - please let me know if this should become 'or'. Or do it yourselves - it's a two character change. Tom Tom
On Mon Apr 19 14:45:07 2010, WYANT wrote: Show quoted text
> On Thu Apr 15 08:55:39 2010, clonezone wrote:
> > On 4/15/10 3:53 AM, Jari Aalto via RT wrote:
> > > "die" used instead of "croak" at line 4, column 24. See page 283
of PBP. Show quoted text
> > > > > > 1 #!/usr/bin/perl > > > 2 use strict; > > > 3 > > > 4 eval "use Pod::Man" or die "$!"
> > > > Certainly looks like a true positive to me.
> > I quote from the POD from P::C::P::ErrorHandling::RequireCarping: > > =head1 BUGS > > This should not complain about using C<warn> or C<die> if it's not in > a function, or if it's in C<main::>. > > A proposed fix, compatible with the above POD, was committed as SVN > revision 3799. Note that a bunch of the tests got 'package' statements > added, since 'die' is now OK in main::.
After discussion on the mailing list, the revised functionality was made conditional on boolean configuration option allow_in_main_unless_in_subroutine, which is false by default. This was committed as SVN revision 3801.