|
NAMEPerl::Critic::Policy::Modules::ProhibitModuleShebang - don't put a #! line at the start of a module fileDESCRIPTIONThis policy is part of the "Perl::Critic::Pulp" add-on. It asks you not to use a "#!" interpreter line in a .pm module file.#!/usr/bin/perl -w <-- bad package Foo; ... This "#!" does nothing but might make a reader think it's supposed to be a program instead of a module. Often the "#!" is a leftover cut and paste from a script into a module, perhaps when grabbing a copyright notice or similar intro. Of course a module works the same with or without, so this policy is low severity and under the "cosmetic" theme (see "POLICY THEMES" in Perl::Critic). Only the first line of a file is a prospective "#!" interpreter. A "#!" anywhere later is allowed, for example in code which generates other code, sub foo { print <<HERE; #!/usr/bin/make <-- ok # Makefile generated by Foo.pm - DO NOT EDIT ... This policy applies only to .pm files. Anything else, such as ".pl" or ".t" scripts can have "#!", or not, in the usual way. Modules are identified by the .pm filename because it's hard to distinguish a module from a script just by the content. DisablingIf you don't care about this you can always disable "ProhibitModuleShebang" from your .perlcriticrc in the usual way (see "CONFIGURATION" in Perl::Critic),[-Modules::ProhibitModuleShebang] CONFIGURATION
SEE ALSOPerl::Critic::Pulp, Perl::CriticHOME PAGE<http://user42.tuxfamily.org/perl-critic-pulp/index.html>COPYRIGHTCopyright 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2019, 2021 Kevin RydePerl-Critic-Pulp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. Perl-Critic-Pulp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Perl-Critic-Pulp. If not, see <http://www.gnu.org/licenses>.
Visit the GSP FreeBSD Man Page Interface. |