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
option. 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 brackets 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}
By default, there are no prohibited modules (although I can think of a few that should be).
NOTES
Note that this policy doesn't apply to pragmas.
AUTHOR
Jeffrey Ryan Thalhammer <thaljef@cpan.org>
COPYRIGHT
Copyright (c) 2005-2009 Jeffrey Ryan Thalhammer. 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.