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: 43038
Status: open
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: ProhibitExitInSubroutines versus blocks
Date: Thu, 05 Feb 2009 10:20:26 +1100
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
In the current cvs BuiltinFunctions::ProhibitExitInSubroutines seems to be tickled by an exit within a block. A exit in a conditional block in a script would be pretty common, and I even quite like to have unconditional blocks with an exit for ease of cut-and-paste when changing things around. Failing cases below.
Index: ProhibitExitInSubroutines.run =================================================================== --- ProhibitExitInSubroutines.run (revision 3103) +++ ProhibitExitInSubroutines.run (working copy) @@ -13,6 +13,8 @@ exit; exit if $condition; $codition || exit(); +if ($condition) { exit 1; } +{ print "local stuff\n"; exit 1; } #-----------------------------------------------------------------------------
On Wed Feb 04 18:54:55 2009, user42@zip.com.au wrote: Show quoted text
> In the current cvs BuiltinFunctions::ProhibitExitInSubroutines seems to > be tickled by an exit within a block. > > A exit in a conditional block in a script would be pretty common, and I > even quite like to have unconditional blocks with an exit for ease of > cut-and-paste when changing things around. Failing cases below. >
I know this has hung fire for a loooooooong time but: Can you confirm at this late date where BuiltinFunctions::ProhibitExitInSubroutines came from? I have downloaded the entire perlcritic Subversion trunk (NOT a trivial undertaking) and been unable to find a ProhibitExitInSubroutines anywhere. Not in Perl-Critic, not in Perl-Critic-More, not in Perl-Critic-StricterSubs, not nowhere, not nohow. In fact, $ find . -iname \*exit\* found only Modules::ProhibitExitMainComplexity and Subroutines::ProhibitExcessComplexity. ProhibitExitInSubroutines is not found by search.cpan.org. Ditto without the final 's'. I have _not_ tried to search the Subversion history, in the belief that there is not incentive to patch a deleted module. But neither can I load the module, which means if it was ever in Perl::Critic or Perl::Critic::More it has been gone for a while. And I don't believe it is (or has recently been) the policy of the Perl::Critic maintainers to delete modules that have actually been released. That's what Perl::Critic::Deprecated is for. I can't speak for anyone else, but I can't work on code I can't find. I'm going to mark this "stalled", with the intent of rejecting it in a week or two unless some progress can be made.
Subject: Re: [rt.cpan.org #43038] ProhibitExitInSubroutines versus blocks
Date: Sat, 16 Oct 2010 08:31:01 +1100
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Tom Wyant via RT" <bug-Perl-Critic@rt.cpan.org> writes: Show quoted text
> > I have downloaded the entire perlcritic Subversion trunk (NOT a trivial > undertaking) and been unable to find a ProhibitExitInSubroutines > anywhere.
Not gone, but recently moved to "jeff" branch it seems, http://perlcritic.tigris.org/source/browse/perlcritic/branches/jeff/ProhibitExit/ProhibitExitInSubroutines.pm?view=markup&pathrev=3174 of rev 3174 http://perlcritic.tigris.org/source/browse/perlcritic?view=rev&revision=3174 I think the concept is still fairly reasonable, but I would still think that if it's called "prohibit in subroutines" then it might like to distinguish between blocks and subroutines if it hasn't by now already done so. -- So if you're an intellectual midget and you like to giggle then you could do worse than see Monty Python and the Holy Grail.
Subject: Re: [rt.cpan.org #43038] ProhibitExitInSubroutines versus blocks
Date: Fri, 15 Oct 2010 14:54:43 -0700
To: bug-Perl-Critic [...] rt.cpan.org
From: "Thalhammer, Jeffrey" <jeff [...] imaginative-software.com>
On Fri, Oct 15, 2010 at 2:31 PM, Kevin Ryde via RT < bug-Perl-Critic@rt.cpan.org> wrote: Show quoted text
> > > http://perlcritic.tigris.org/source/browse/perlcritic?view=rev&revision=3174 > > I think the concept is still fairly reasonable, but I would still think > that if it's called "prohibit in subroutines" then it might like to > distinguish between blocks and subroutines if it hasn't by now already > done so. >
I had completely forgotten about that Policy. It looks like it is still broken, with respect to blocks. I'll try to bring it back to life for the next release (which should be some time this month). Unfortunately, my Mac is in the shop, so I won't get around to this until the middle of next week. -Jeff