On Wed May 19 20:21:15 2010, clonezone wrote:
Show quoted text> On 5/19/10 12:49 PM, Olivier 'dolmen' Mengué via RT wrote:
> > The common idiom for POE programming is:
> >
> > use POE;
> > sub my_event
> > {
> > my ($k, $s, $arg0) = @_[KERNEL, SESSION, ARG0];
> >
> > ...
> > }
> >
> > Subroutines::RequireArgUnpacking should detect this style as correct
> @_
> > unpacking.
>
> What version of Perl::Critic are you using? This is a duplicate of
>
https://rt.cpan.org/Public/Bug/Display.html?id=34009 which was
> supposedly fixed.
The docs for Perl::Critic::Policy::Subroutines::RequireArgUnpacking say
By default this policy does not allow you to specify array subscripts
when you unpack arguments (i.e. by an array slice or by referencing
individual elements). Should you wish to permit this, you can do so
using the "allow_subscripts" setting. This defaults to false. You can
set it true like this:
[Subroutines::RequireArgUnpacking]
allow_subscripts = 1
Did you in fact do this in your .perlcriticrc file?
Alternatively, did you use @_ anywhere else in the subroutine? This
policy does not simply look for an unpacking it understands -- it looks
for _all_ uses of @_, and complains if it sees any it does not like. I
have been bitten by this a couple times when making my code Perl::Critic
compliant.