Perl::Critic::Pulp::Utils - shared helper code for the Pulp perlcritic add-on
use Perl::Critic::Pulp::Utils;
This is slightly preliminary, but works as far as it goes.
$pkgelem = Perl::Critic::Pulp::Utils::elem_package ($elem)
$elem is a PPI::Element. Return the PPI::Statement::Package containing $elem, or undef if $elem is not in the scope of any package statement.
$elem
PPI::Element
PPI::Statement::Package
undef
The search upwards begins with the element preceding $elem, so if $elem itself is a PPI::Statement::Package then that's not the one returned, instead its containing package.
Perl::Critic::Pulp::Utils::parameter_parse_version ($self, $parameter, $str)
This is designed for use as the parser field of a policy supported_parameters entry for a parameter which is a version number.
parser
supported_parameters
Parse $str with the version.pm module. If valid then set $self-{$paramter->get_name}> to the resulting version object, if not then call throw_parameter_value_exception.
$str
version.pm
$self-
version
throw_parameter_value_exception
Perl::Critic::Pulp
http://user42.tuxfamily.org/perl-critic-pulp/index.html
Copyright 2008, 2009, 2010, 2011 Kevin Ryde
Perl-Critic-Pulp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Perl-Critic-Pulp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Perl-Critic-Pulp. If not, see <http://www.gnu.org/licenses/>.
To install Perl::Critic::Pulp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::Pulp
CPAN shell
perl -MCPAN -e shell install Perl::Critic::Pulp
For more information on module installation, please visit the detailed CPAN module installation guide.