GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PERL::CRITIC::POLICY::MODULES::PROHIBITEVILMODULES (3)

.ds Aq ’

NAME

Perl::Critic::Policy::Modules::ProhibitEvilModules - Ban modules that aren’t blessed by your shop.

CONTENTS

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 dont 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 dont 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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PERL::CRITIC::POLICY::MODULES::PROHIBITEVILMODULES (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.