1Perl::Critic::Policy::MUosdeurPleeCrsol:n::t:PrCrirobihutitibecid:t:EPPveoirllliMcoDydo:uc:luMemosed(nu3tl)aetsi:o:nProhibitEvilModules(3)
2
3
4

NAME

6       Perl::Critic::Policy::Modules::ProhibitEvilModules - Ban modules that
7       aren't blessed by your shop.
8

AFFILIATION

10       This Policy is part of the core Perl::Critic distribution.
11

DESCRIPTION

13       Use this policy if you wish to prohibit the use of specific modules.
14       These may be modules that you feel are deprecated, buggy, unsupported,
15       insecure, or just don't like.
16

CONFIGURATION

18       The set of prohibited modules is configurable via the "modules" and
19       "modules_file" options.
20
21       The value of "modules" should be a string of space-delimited, fully
22       qualified module names and/or regular expressions.  An example of
23       prohibiting two specific modules in a .perlcriticrc file:
24
25           [Modules::ProhibitEvilModules]
26           modules = Getopt::Std Autoload
27
28       Regular expressions are identified by values beginning and ending with
29       slashes.  Any module with a name that matches "m/pattern/" will be
30       forbidden.  For example:
31
32           [Modules::ProhibitEvilModules]
33           modules = /Acme::/
34
35       would cause all modules that match "m/Acme::/" to be forbidden.
36
37       In addition, you can override the default message ("Prohibited module
38       "module" used") with your own, in order to give suggestions for
39       alternative action.  To do so, put your message in curly braces after
40       the module name or regular expression.  Like this:
41
42           [Modules::ProhibitEvilModules]
43           modules = Fatal {Found use of Fatal. Use autodie instead} /Acme::/ {We don't use joke modules}
44
45       Similarly, the "modules_file" option gives the name of a file
46       containing specifications for prohibited modules.  Only one module
47       specification is allowed per line and comments start with an octothorp
48       and run to end of line; no curly braces are necessary for delimiting
49       messages:
50
51           Evil     # Prohibit the "Evil" module and use the default message.
52
53           # Prohibit the "Fatal" module and give a replacement message.
54           Fatal Found use of Fatal. Use autodie instead.
55
56           # Use a regular expression.
57           /Acme::/     We don't use joke modules.
58
59       By default, the modules that have been deprecated by the Perl 5 Porters
60       are reported; at the time of writing these are Class::ISA,
61       Pod::Plainer, Shell, and Switch.  Specifying a value for the "modules"
62       option will override this.
63

NOTES

65       Note that this policy doesn't apply to pragmas.
66

AUTHOR

68       Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
69
71       Copyright (c) 2005-2023 Imaginative Software Systems
72
73       This program is free software; you can redistribute it and/or modify it
74       under the same terms as Perl itself.  The full text of this license can
75       be found in the LICENSE file included with this module.
76
77
78
79perl v5.36.0             Perl::Cri2t0i2c3:-:0P3o-l0i5cy::Modules::ProhibitEvilModules(3)
Impressum