Login
RT #72086 - ProhibitUnusedCapture false positive with /e and parens
authorTom Wyant <harryfmudd@comcast.net>
Tue, 1 Nov 2011 15:48:42 +0000 (15:48 +0000)
committerTom Wyant <harryfmudd@comcast.net>
Tue, 1 Nov 2011 15:48:42 +0000 (15:48 +0000)
commitdf7de226a0380cd2acead384d9c4f178c8772677
tree52b6cddaf83335385c264e2ffbe07ea62c8d9359
parent204076da0c947a68b7e01ec880909f81429ebe8e
RT #72086 - ProhibitUnusedCapture false positive with /e and parens

The problem was that the policy was simply looking at the top level of
the replacement expression. Fortunately this was just a matter of
calling the right subroutine. This should cover (?{}) and (??{}) as
well, though I was not ambitious enough to add them to the tests.
Changes
lib/Perl/Critic/Policy/RegularExpressions/ProhibitUnusedCapture.pm
t/RegularExpressions/ProhibitUnusedCapture.run