Perl-Critic-Policy-CompileTime
view release on metacpan or search on metacpan
Perl::Critic::Policy::CompileTime is a Perl::Critic module which allows one to
quickly find code in a large codebase or installation which may not run the way
one expects when compiled by the Perl compiler, B::C. With the help of the
underlying code in PPIx::PerlCompiler, it does so by performing some rudimentary
pattern matching against statements and subexpressions in specific instances.
## FEATURES
PPIx::PerlCompiler provides the ability to check compile time code blocks,
BEGIN, UNITCHECK, and CHECK, for code that may likely have system-wide side
effects, or may perform I/O that may invalidate dependent state of compiled
binaries when they run.
Perl::Critic::Policy::CompileTime issues severity level 40 advisories regarding
the aforementioned features in Perl code. To use this module with Perl::Critic,
simply add something like the following to your .perlcriticrc file:
include = CompileTime
# SEE ALSO
lib/PPIx/PerlCompiler/Element.pm view on Meta::CPAN
}
}
return 1;
}
sub isa_prerun_block {
my ($self) = @_;
return $self->isa('PPI::Statement::Scheduled')
&& $self->non_whitespace_child(0)->matches( 'PPI::Token::Word' => qr/^(BEGIN|UNITCHECK|CHECK)$/ );
}
1;
lib/Perl/Critic/Policy/CompileTime.pm view on Meta::CPAN
Perl::Critic::Policy::CompileTime is a Perl::Critic module which allows one to
quickly find code in a large codebase or installation which may not run the way
one expects when compiled by the Perl compiler, B::C. With the help of the
underlying code in PPIx::PerlCompiler, it does so by performing some rudimentary
pattern matching against statements and subexpressions in specific instances.
=head2 FEATURES
PPIx::PerlCompiler provides the ability to check compile time code blocks,
BEGIN, UNITCHECK, and CHECK, for code that may likely have system-wide side
effects, or may perform I/O that may invalidate dependent state of compiled
binaries when they run.
Perl::Critic::Policy::CompileTime issues severity level 40 advisories regarding
the aforementioned features in Perl code. To use this module with Perl::Critic,
simply add something like the following to your .perlcriticrc file:
include = CompileTime
=head1 SEE ALSO
( run in 1.870 second using v1.01-cache-2.11-cpan-748bfb374f4 )