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

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

Bug Information
Severity: Important
Broken in:
  • 1.118
  • 1.119
Fixed in: (no value)



Subject: New warning in 5.19.4
Possible precedence issue with control flow operator at /Users/ether/.perlbrew/libs/19.4@std/lib/perl5/Perl/Critic/Utils.pm line 334, <GEN1> line 11. My recollection of discussions on p5p are that some additional checks were added for pathological code such as "return foo or ...", as precedence rules are that the additional code would never be reached.
On Sat Sep 21 13:37:58 2013, ETHER wrote: Show quoted text
> Possible precedence issue with control flow operator at > /Users/ether/.perlbrew/libs/19.4@std/lib/perl5/Perl/Critic/Utils.pm > line 334, <GEN1> line 11. > > My recollection of discussions on p5p are that some additional checks > were added for pathological code such as "return foo or ...", as > precedence rules are that the additional code would never be reached.
The discussion is at <https://rt.perl.org/rt3/Ticket/Display.html?id=59802>. The attached patch changes the code to what I think was intended.
Subject: open_ov6QYLjd.txt
diff -rup Perl-Critic-1.118-j0sKNN-orig/lib/Perl/Critic/Utils.pm Perl-Critic-1.118-j0sKNN/lib/Perl/Critic/Utils.pm --- Perl-Critic-1.118-j0sKNN-orig/lib/Perl/Critic/Utils.pm 2013-09-21 10:39:43.000000000 -0700 +++ Perl-Critic-1.118-j0sKNN/lib/Perl/Critic/Utils.pm 2013-09-21 10:39:54.000000000 -0700 @@ -331,7 +331,7 @@ sub hashify { ## no critic (ArgUnpackin sub interpolate { my ( $literal ) = @_; - return eval "\"$literal\"" or confess $EVAL_ERROR; ## no critic (StringyEval); + return eval "\"$literal\"" || confess $EVAL_ERROR; ## no critic (StringyEval); } #-----------------------------------------------------------------------------
RT-Send-CC: KRYDE [...] cpan.org
FYI, KRYDE/Perl-Critic-Pulp-80.tar.gz fails its tests due to this new warning.
This is a very simple patch; could someone apply and release it, please?
RT-Send-CC: ether [...] cpan.org
On Fri Oct 25 11:31:27 2013, ETHER wrote: Show quoted text
> This is a very simple patch; could someone apply and release it, please?
Done. Perl-Critic-1.120 has been shipped to CPAN. Sorry for the delay.