1Perl::Critic::Policy::MUosdeurPleeCrsol:n::t:PrCrirobihutitibecid:t:EPPveoirllliMcoDydo:uc:luMemosed(nu3tl)aetsi:o:nProhibitEvilModules(3)
2
3
4
6 Perl::Critic::Policy::Modules::ProhibitEvilModules - Ban modules that
7 aren't blessed by your shop.
8
10 This Policy is part of the core Perl::Critic distribution.
11
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
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, there are no prohibited modules (although I can think of a
60 few that should be).
61
63 Note that this policy doesn't apply to pragmas.
64
66 Jeffrey Ryan Thalhammer <thaljef@cpan.org>
67
69 Copyright (c) 2005-2009 Jeffrey Ryan Thalhammer. All rights reserved.
70
71 This program is free software; you can redistribute it and/or modify it
72 under the same terms as Perl itself. The full text of this license can
73 be found in the LICENSE file included with this module.
74
75
76
77perl v5.12.1 Perl::Cri2t0i1c0:-:0P9o-l0i8cy::Modules::ProhibitEvilModules(3)