Subject: | Always unpack @_ first reported wrong for simple sub |
When running perlcritic (theme: core, severity: 3) against the attached
file (Catalyst::Plugin::Session::State::QpAPI.pm) always the always
unpack @_ error is reported.
Here is the cli output:
<code>
sh$ perlcritic --profile t/perlcriticrc
lib/Catalyst/Plugin/Session/State/QpAPI.pm -v 9
[Subroutines::RequireArgUnpacking] Always unpack @_ first at line 11,
near 'sub get_session_id {'. (Severity: 4)
</code>
Also tested with Perl::Critic 1.081_006 with the same result.
Subject: | QpAPI.pm |
package Catalyst::Plugin::Session::State::QpAPI;
use base qw/Catalyst::Plugin::Session::State/;
use strict;
use warnings;
use NEXT;
our $VERSION = "0.1";
sub get_session_id {
my ($c) = @_;
if ($c->request->path =~ /^qpapi\//x) {
my $sid = $c->request->param("sessionid") || "";
if ($sid) {
$c->log->debug(qq/Found sessionid "$sid" in qpapi request/) if $c->debug;
return $sid if $sid;
}
}
return $c->NEXT::get_session_id(@_);
}
1;
__END__
=pod
=head1 NAME
Catalyst::Plugin::Session::State::QpAPI - Maintain session IDs using post params for qpapi path.
=head1 SYNOPSIS
use Catalyst qw/Session Session::State::QpAPI/;
=head1 DESCRIPTION
In order for L<Catalyst::Plugin::Session> to work the session ID needs to be
stored on the client, and the session data needs to be stored on the server.
This plugin allows retrieval of the sessionid in the post param sessionid.
=head1 METHODS
=over 4
=item get_session_id
=back
=head1 SEE ALSO
L<Catalyst>, L<Catalyst::Plugin::Session>. L<Catalyst::Plugin::Session::State::Cookie>
=head1 AUTHORS
Roland Lammel <lt>rl@brabbel.net<gt>
=head1 COPYRIGHT
This program is free software, you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
1;