Subject: | P::C::Policy::RegularExpressions::ProhibitCaptureWithoutTest does not recognize the trinary conditional as a test... |
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.
Subject: | code.pl |
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))
;