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

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

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



Subject: Another ProhibitUnusedCapture false positive
I think that ProhibitUnusedCapture doesn't understand ${1} on the RHS of a substitution, for example #!/usr/bin/perl # $Id: $ use warnings; use strict; use Carp qw(croak); our $VERSION = 1; $_ = 'bab'; s/b(a)b/${1}/sxm; print $_ or croak;
On Wed Apr 06 08:49:52 2011, EDAVIS wrote: Show quoted text
> I think that ProhibitUnusedCapture doesn't understand ${1} on the RHS of > a substitution, for example > > #!/usr/bin/perl > # $Id: $ > use warnings; > use strict; > use Carp qw(croak); > our $VERSION = 1; > > $_ = 'bab'; > s/b(a)b/${1}/sxm; > print $_ or croak;
I have good news and bad news. The bad news is that I can not duplicate this. The good news is that this looks like a PPIx::Regexp bug that was fixed in version 0.018, which went out 16-Feb-2011. What version of PPIx::Regexp are you running? If less than 0.018, can you upgrade, and does upgrading fix the problem?
I can confirm that this is buggy with PPIx::Regexp 0.014 and correct with PPIx::Regexp 0.020.
On Thu Apr 07 07:11:43 2011, EDAVIS wrote: Show quoted text
> I can confirm that this is buggy with PPIx::Regexp 0.014 and correct > with PPIx::Regexp 0.020.
I have bumped the required version of PPIx::Regexp to 0.019, since that is the version that understands the most about things like s/(a)/${1}/. Version 0.020 is out, but all it has above 0.019 is a tweak in the perl_version_introduced() logic, which Perl::Critic does not use (I think). This is SVN revision 4073.
Sending the previous mail has failed. Please contact your admin, they can find more details in the logs.
Sending the previous mail has failed. Please contact your admin, they can find more details in the logs.
Fixed and released in Perl-Critic-1.117. Thanks for reporting this. -- Jeffrey Thalhammer Imaginative Software Systems www.imaginative-software.com