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

Owner: Nobody in particular
Requestors: csjewell [...]

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

Subject: P::C::Policy::RegularExpressions::ProhibitCaptureWithoutTest does not recognize the trinary conditional as a test...
Download (untitled) / with headers
text/plain 268b
This may not be a "bug" per say, but this code passes the spirit of the check, if not the letter of what it's currently checking... Maybe it should check for the regexp capture variables being in the ? portion of the "trinary conditional" (not the : part), as well.
text/x-perl 649b
my $addr = ($smtp_server =~ m{ # Match \A # ... start of the string, (\d{1,3}) # ... then 1-3 digits, \.(\d{1,3}) # ... then a dot and 1-3 digits \.(\d{1,3}) # ... then do it again \.(\d{1,3}) # ... then do it yet again \z # ... then match the end of the string. }xms) ? pack('C4', $1, $2, $3, $4) ##no critic (ProhibitCaptureWithoutTest) : (gethostbyname($smtp_server)) ;
From: admwiggin [...]
Download (untitled) / with headers
text/plain 101b
As far as I can tell, this bug is fixed in the most recent release (working in my codebase, anyhow).
Download (untitled) / with headers
text/plain 167b
I just hit this, with v1.118, on this code: my $proxy_port = ($proxy =~ s/:(\d+)//) ? $1 : 8888; Capture variable used outside conditional (See page 253 of PBP)

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to