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

People
Owner: Nobody in particular
Requestors: phillipm [...] tierra.net
Cc:
AdminCc:

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



Subject: false positive for capture var used in ternary condition
Date: Mon, 25 Sep 2006 13:58:47 -0700
To: bug-Perl-Critic [...] rt.cpan.org
From: <phillipm [...] tierra.net>
Hi, Using Perl::Critic-0.2 with perl 5.8.8 on FreeBSD, I get "Capture variable used outside conditional at ..." for the code: my $foo = $bar =~ /\A (\w+) \z/mx ? $1 : 'default'; Thanks. Phil
From: CLOTHO [...] cpan.org
On Mon Sep 25 16:58:47 2006, phillipm@tierra.net wrote: Show quoted text
> Hi, > Using Perl::Critic-0.2 with perl 5.8.8 on FreeBSD, > > I get "Capture variable used outside conditional at ..." for the code: > > my $foo = $bar =~ /\A (\w+) \z/mx ? $1 : 'default'; > > Thanks. > > Phil >
Ooh, good catch! I forgot about ternaries. I'm headed out on vacation in a few hours(!) but I'll look at this when I get back. -- Chris
This is now fixed in SVN revision 687. This fix will appear in the next Perl::Critic release.