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

People
Owner: Nobody in particular
Requestors: andrew [...] sericyb.com.au
Cc:
AdminCc:

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



Subject: Perl::Critic::Policy::Subroutines::RequireArgUnpacking false positive in foreach
Date: Thu, 25 Sep 2008 15:40:34 +0930
To: bug-Perl-Critic [...] rt.cpan.org
From: Andrew Pam <andrew [...] sericyb.com.au>
Code like this triggers a false positive: my @a = ( [ 1, 2 ], [ 3, 4 ] ); print @$_[0] foreach @a; Workaround: print @{$_}[0] foreach @a; Regards, Andrew
On Thu Sep 25 02:10:57 2008, andrew@sericyb.com.au wrote: Show quoted text
> Code like this triggers a false positive: > > my @a = ( [ 1, 2 ], [ 3, 4 ] ); > print @$_[0] foreach @a;
I've committed a fix for this to: http://perlcritic.tigris.org/svn/perlcritic/branches/rt39601 I assume that something like the following shouldn't be allowed: my @a = ( [ 1, 2 ], [ 3, 4 ] ); for (@a){ say @$_[0]; } but more because one should use a named variable in the for statement. Either way, that is still a policy violation.
Subject: Re: [rt.cpan.org #39601] Perl::Critic::Policy::Subroutines::RequireArgUnpacking false positive in foreach
Date: Sun, 15 Feb 2009 16:18:34 -0600
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
The branch has been merged to trunk.
This has been completed and released in Perl-Critic-1.097_002. http://search.cpan.org/~elliotjs/Perl-Critic-1.097_002 Thank you for submitting this ticket.