Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

perl::critic::policy::modules::prohibitevilmodules(3pm) [debian man page]

Perl::Critic::Policy::Modules::ProhibitEvilModules(3pm) User Contributed Perl DocumentationPerl::Critic::Policy::Modules::ProhibitEvilModules(3pm)

NAME
Perl::Critic::Policy::Modules::ProhibitEvilModules - Ban modules that aren't blessed by your shop. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Use this policy if you wish to prohibit the use of specific modules. These may be modules that you feel are deprecated, buggy, unsupported, insecure, or just don't like. CONFIGURATION
The set of prohibited modules is configurable via the "modules" and "modules_file" options. The value of "modules" should be a string of space-delimited, fully qualified module names and/or regular expressions. An example of prohibiting two specific modules in a .perlcriticrc file: [Modules::ProhibitEvilModules] modules = Getopt::Std Autoload Regular expressions are identified by values beginning and ending with slashes. Any module with a name that matches "m/pattern/" will be forbidden. For example: [Modules::ProhibitEvilModules] modules = /Acme::/ would cause all modules that match "m/Acme::/" to be forbidden. In addition, you can override the default message ("Prohibited module "module" used") with your own, in order to give suggestions for alternative action. To do so, put your message in curly braces after the module name or regular expression. Like this: [Modules::ProhibitEvilModules] modules = Fatal {Found use of Fatal. Use autodie instead} /Acme::/ {We don't use joke modules} Similarly, the "modules_file" option gives the name of a file containing specifications for prohibited modules. Only one module specification is allowed per line and comments start with an octothorp and run to end of line; no curly braces are necessary for delimiting messages: Evil # Prohibit the "Evil" module and use the default message. # Prohibit the "Fatal" module and give a replacement message. Fatal Found use of Fatal. Use autodie instead. # Use a regular expression. /Acme::/ We don't use joke modules. By default, the modules that have been deprecated by the Perl 5 Porters are reported; at the time of writing these are Class::ISA, Pod::Plainer, Shell, and Switch. Specifying a value for the "modules" option will override this. NOTES
Note that this policy doesn't apply to pragmas. AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.14.2 2012-06-07 Perl::Critic::Policy::Modules::ProhibitEvilModules(3pm)

Check Out this Related Man Page

Perl::Critic::Policy::Modules::RequireExplicitPackage(3pUser Contributed Perl DocumentatPerl::Critic::Policy::Modules::RequireExplicitPackage(3pm)

NAME
Perl::Critic::Policy::Modules::RequireExplicitPackage - Always make the "package" explicit. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
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. There are some valid reasons for not having a "package" statement at all. But make sure you understand them before assuming that you should do it too. The maximum number of violations per document for this policy defaults to 1. CONFIGURATION
As for programs, most people understand that the default package is "main", so this Policy doesn't apply to files that begin with a perl shebang. If you want to require an explicit "package" declaration in all files, including programs, then add the following to your .perlcriticrc file [Modules::RequireExplicitPackage] exempt_scripts = 0 Some users may find it desirable to exempt the load of specific modules from this policy. For example, Perl does not support Unicode module names because of portability problems. Users who are not concerned about this and intend to use "UTF-8" module names will need to specify "use utf8;" before the package declaration. To do this, add the following to your .perlcriticrc file [Modules::RequireExplicitPackage] allow_import_of = utf8 The "allow_import_of" configuration option takes multiple module names, separated by spaces. IMPORTANT CHANGES
This policy was formerly called "ProhibitUnpackagedCode" which sounded a bit odd. If you get lots of "Cannot load policy module" errors, then you probably need to change "ProhibitUnpackagedCode" to "RequireExplicitPackage" in your .perlcriticrc file. AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.14.2 2012-06-07 Perl::Critic::Policy::Modules::RequireExplicitPackage(3pm)
Man Page