Perl::Critic::Policy::Lax::RequireExplicitPackage::ExceptForPragmata - Perl::Critic::Policy::Lax::RequireExplicitPackage::ExceptForPragmata documentation


Perl-Critic-Lax documentation  | view source Contained in the Perl-Critic-Lax distribution.

Index


NAME

Top

Perl::Critic::Policy::Lax::RequireExplicitPackage::ExceptForPragmata

VERSION

Top

version 0.008

DESCRIPTION

Top

This policy is meant to replace Modules::RequireExplicitPackage. That policy's POD says:

  In general, the first statement of any Perl module or library should be a
  package statement.  Otherwise, all the code that comes before the package
  statement is getting executed in the caller's package, and you have no idea
  who that is.  Good encapsulation and common decency require your module to
  keep its innards to itself.

Sure, that's swell for code that has effect at a package level, but some statements are lexical. This policy makes allowance for some of those cases. By default, it permits turning on strictures, warnings, features, and diagnostics, as well as requiring a minimum Perl version.

METHODS

Top

supported_parameters

The default list of pragmata that are permitted before a package declaration can be changed via the allowed_pragmata configuration parameter. Its value is a space-separated list of pragma names to be permitted. In this list, the name perlversion is special: it allows a use 5.xxx statement.

This module understands the exempt_scripts configuration parameter just like Perl::Critic::Policy::Modules::RequireExplicitPackage.

AUTHOR

Top

Ricardo SIGNES <rjbs@cpan.org>

Adapted from Modules::RequireExplicitPackage by Jeffrey Ryan Thalhammer.

COPYRIGHT

Top


Perl-Critic-Lax documentation  | view source Contained in the Perl-Critic-Lax distribution.