Perl::Critic::Pulp::Utils(3pm) | User Contributed Perl Documentation | Perl::Critic::Pulp::Utils(3pm) |
Perl::Critic::Pulp::Utils - shared helper code for the Pulp perlcritic add-on
use Perl::Critic::Pulp::Utils;
This is a bit of a grab bag, but works as far as it goes.
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.
{ name => 'above_version', description => 'Check only above this version of Perl.', behavior => 'string', parser => \&Perl::Critic::Pulp::Utils::parameter_parse_version, }
$str is parsed with the "version.pm" module. If valid then the parameter is set with "$self->__set_parameter_value" to the resulting "version" object (so for example field $self->{'_above_version'}). If invalid then an exception is thrown per "$self->throw_parameter_value_exception".
Nothing is exported by default, but the functions can be requested in usual "Exporter" style,
use Perl::Critic::Pulp::Utils 'elem_in_BEGIN'; if (elem_in_BEGIN($elem)) { # ... }
There's no ":all" tag since this module is meant as a grab-bag of functions and importing as-yet unknown things would be asking for name clashes.
Perl::Critic::Pulp, Perl::Critic, PPI
<http://user42.tuxfamily.org/perl-critic-pulp/index.html>
Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2019, 2021 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/>.
2021-02-28 | perl v5.32.1 |