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

People
Owner: Nobody in particular
Requestors: perl [...] galumph.com
Cc:
AdminCc:

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



CC: Heiko <heiko [...] hexco.de>
Subject: RequireArgUnpacking doesn't handle assignment to variables outside subroutine scope.
Date: Sun, 09 Mar 2008 17:03:10 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Subroutines::RequireArgUnpacking gives Always unpack @_ first at line 10, column 1. See page 178 of PBP. (Severity: 4) on this code my $y; sub set_y { my $x; ($y, $x) = @_; return; } The workaround would be to use ($y, my $x) = @_; instead of my $x; ($y, $x) = @_;
Subject: Re: [rt.cpan.org #33940] RequireArgUnpacking doesn't handle assignment to variables outside subroutine scope.
Date: Sun, 09 Mar 2008 17:57:11 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Elliot Shank via RT wrote: Show quoted text
> Subroutines::RequireArgUnpacking > gives > Always unpack @_ first at line 10, column 1. See page 178 of PBP. (Severity: 4) > on this code > > my $y; > > sub set_y > { > my $x; > ($y, $x) = @_; > return; > } > > The workaround would be to use > ($y, my $x) = @_; > instead of > my $x; > ($y, $x) = @_;
That's not a workaround, that's what the policy intends for you to do.
On Sun Mar 09 18:57:24 2008, clonezone wrote: Show quoted text
> Elliot Shank via RT wrote:
> > > > The workaround would be to use > > ($y, my $x) = @_; > > instead of > > my $x; > > ($y, $x) = @_;
> > That's not a workaround, that's what the policy intends for you to do.
It isn't pretty, but I agree with Elliot on this. So I'm marking this as 'resolved'.