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
Perl::Critic::PolicySummary(3) User Contributed Perl Documentation Perl::Critic::PolicySummary(3)

Perl::Critic::PolicySummary - Descriptions of the Policy modules included with Perl::Critic itself.

The following Policy modules are distributed with Perl::Critic. (There are additional Policies that can be found in add-on distributions.) The Policy modules have been categorized according to the table of contents in Damian Conway's book Perl Best Practices. Since most coding standards take the form "do this..." or "don't do that...", I have adopted the convention of naming each module "RequireSomething" or "ProhibitSomething". Each Policy is listed here with its default severity. If you don't agree with the default severity, you can change it in your .perlcriticrc file (try "perlcritic --profile-proto" for a starting version). See the documentation of each module for its specific details.

Use "List::MoreUtils::any" instead of "grep" in boolean context. [Default severity 2]

Map blocks should have a single statement. [Default severity 3]

Use 4-argument "substr" instead of writing "substr($foo, 2, 6) = $bar". [Default severity 3]

Forbid $b before $a in sort blocks. [Default severity 1]

Prohibit "\shift" in code [Default severity 3]

Use Time::HiRes instead of something like "select(undef, undef, undef, .05)". [Default severity 5]

Write "eval { my $foo; bar($foo) }" instead of "eval "my $foo; bar($foo);"". [Default severity 5]

Write "split /-/, $string" instead of "split '-', $string". [Default severity 2]

Write "eval { $foo->can($name) }" instead of "UNIVERSAL::can($foo, $name)". [Default severity 3]

Write "eval { $foo->isa($pkg) }" instead of "UNIVERSAL::isa($foo, $pkg)". [Default severity 3]

Don't pass $_ to built-in functions that assume it, or to most filetest operators. [Default severity 2]

Don't use "grep" in void contexts. [Default severity 3]

Don't use "map" in void contexts. [Default severity 3]

Write "grep { /$pattern/ } @list" instead of "grep /$pattern/, @list". [Default severity 4]

Write "map { /$pattern/ } @list" instead of "map /$pattern/, @list". [Default severity 4]

Use "glob q{*}" instead of <*>. [Default severity 5]

Sort blocks should have a single statement. [Default severity 3]

AUTOLOAD methods should be avoided. [Default severity 3]

Employ "use base" instead of @ISA. [Default severity 3]

Write "bless {}, $class;" instead of just "bless {};". [Default severity 5]

Use spaces instead of tabs. [Default severity 3]

Write "open $handle, $path" instead of "open($handle, $path)". [Default severity 1]

Write "qw(foo bar baz)" instead of "('foo', 'bar', 'baz')". [Default severity 2]

Don't use whitespace at the end of lines. [Default severity 1]

Use the same newline through the source. [Default severity 4]

Must run code through perltidy. [Default severity 1]

Put a comma at the end of every multi-line list declaration, including the last one. [Default severity 1]

Write "for(0..20)" instead of "for($i=0; $i<=20; $i++)". [Default severity 2]

Don't write long "if-elsif-elsif-elsif-elsif...else" chains. [Default severity 3]

Don't write deeply nested loops and conditionals. [Default severity 3]

Don't use labels that are the same as the special block names. [Default severity 4]

Don't modify $_ in list functions. [Default severity 5]

Don't use operators like "not", "!~", and "le" within "until" and "unless". [Default severity 3]

Write "if($condition){ do_something() }" instead of "do_something() if $condition". [Default severity 2]

Write "if(! $condition)" instead of "unless($condition)". [Default severity 2]

Don't write code after an unconditional "die, exit, or next". [Default severity 4]

Write "while(! $condition)" instead of "until($condition)". [Default severity 2]

Never use "..." in production code. [Default severity 4]

Check your spelling. [Default severity 1]

The "=head1 NAME" section should match the package. [Default severity 1]

All POD should be after "__END__". [Default severity 1]

Organize your POD into the customary sections. [Default severity 2]

Use functions from Carp instead of "warn" or "die". [Default severity 3]

You can't depend upon the value of $@/$EVAL_ERROR to tell whether an "eval" failed. [Default severity 3]

Discourage stuff like "@files = `ls $directory`". [Default severity 3]

Write "open my $fh, q{<}, $filename;" instead of "open FH, q{<}, $filename;". [Default severity 5]

Use "<>" or "<ARGV>" or a prompting module instead of "<STDIN>". [Default severity 4]

Use prompt() instead of -t. [Default severity 5]

Use "local $/ = undef" or Path::Tiny instead of joined readline. [Default severity 3]

Never write "select($fh)". [Default severity 4]

Write "while( $line = <> ){...}" instead of "for(<>){...}". [Default severity 4]

Write "open $fh, q{<}, $filename;" instead of "open $fh, "<$filename";". [Default severity 5]

Write "print {$FH} $foo, $bar;" instead of "print $FH $foo, $bar;". [Default severity 1]

Close filehandles as soon as possible after opening them. [Default severity 4]

Write "my $error = close $fh;" instead of "close $fh;". [Default severity 2]

Write "my $error = open $fh, $mode, $filename;" instead of "open $fh, $mode, $filename;". [Default severity 3]

Return value of flagged function ignored. [Default severity 1]

Write "open $fh, q{<:encoding(UTF-8)}, $filename;" instead of "open $fh, q{<:utf8}, $filename;". [Default severity 5]

Do not use "format". [Default severity 3]

Do not use "tie". [Default severity 2]

Forbid a bare "## no critic" [Default severity 3]

Remove ineffective "## no critic" annotations. [Default severity 2]

Export symbols via @EXPORT_OK or %EXPORT_TAGS instead of @EXPORT. [Default severity 4]

Avoid putting conditional logic around compile-time includes. [Default severity 3]

Ban modules that aren't blessed by your shop. [Default severity 5]

Minimize complexity in code that is outside of subroutines. [Default severity 3]

Put packages (especially subclasses) in separate files. [Default severity 4]

Write "require Module" instead of "require 'Module.pm'". [Default severity 5]

End each module with an explicitly "1;" instead of some funky expression. [Default severity 4]

Always make the "package" explicit. [Default severity 4]

Package declaration must match filename. [Default severity 5]

"use English" must be passed a "-no_match_vars" argument. [Default severity 2]

Give every module a $VERSION number. [Default severity 2]

Distinguish different program components by case. [Default severity 1]

Don't use vague variable or subroutine names like 'last' or 'record'. [Default severity 3]

Prohibit indirect object call syntax. [Default severity 4]

Write "@{ $array_ref }" instead of @$array_ref. [Default severity 2]

Capture variable used outside conditional. [Default severity 3]

Split long regexps into smaller "qr//" chunks. [Default severity 3]

Use named character classes instead of explicit character lists. [Default severity 1]

Use character classes for literal meta-characters instead of escapes. [Default severity 1]

Use "eq" or hash instead of fixed-pattern regexps. [Default severity 2]

Use "[abc]" instead of "a|b|c". [Default severity 1]

Only use a capturing group if you plan to use the captured value. [Default severity 3]

Use only "//" or "{}" to delimit regexps. [Default severity 1]

Don't use $_ to match against regexes. [Default severity 2]

Use "{" and "}" to delimit multi-line regexps. [Default severity 1]

Always use the "/s" modifier with regular expressions. [Default severity 2]

Always use the "/x" modifier with regular expressions. [Default severity 3]

Always use the "/m" modifier with regular expressions. [Default severity 2]

Don't call functions with a leading ampersand sigil. [Default severity 2]

Don't declare your own "open" function. [Default severity 4]

Minimize complexity by factoring code into smaller subroutines. [Default severity 3]

Return failure with bare "return" instead of "return undef". [Default severity 5]

Too many arguments. [Default severity 3]

"sub never { sub correct {} }". [Default severity 5]

Behavior of "sort" is not defined if called in scalar context. [Default severity 5]

Don't write "sub my_function (@@) {}". [Default severity 5]

Prevent unused private subroutines. [Default severity 3]

Prevent access to private subs in other packages. [Default severity 3]

Always unpack @_ first. [Default severity 4]

End every path through a subroutine with an explicit "return" statement. [Default severity 4]

Prohibit various flavors of "no strict". [Default severity 5]

Prohibit various flavors of "no warnings". [Default severity 4]

Don't turn off strict for large blocks of code. [Default severity 4]

Tests should all have labels. [Default severity 3]

Always "use strict". [Default severity 5]

Always "use warnings". [Default severity 4]

Don't use the comma operator as a statement separator. [Default severity 4]

Prohibit version values from outside the module. [Default severity 3]

Don't "use constant FOO => 15". [Default severity 4]

Write "q{}" instead of ''. [Default severity 2]

Write "\N{DELETE}" instead of "\x7F", etc. [Default severity 2]

Use concatenation or HEREDOCs instead of literal line breaks in strings. [Default severity 3]

Always use single quotes for literal strings. [Default severity 1]

Write "oct(755)" instead of 0755. [Default severity 5]

Long chains of method calls indicate tightly coupled code. [Default severity 2]

Don't use values that don't explain themselves. [Default severity 2]

Don't mix numeric operators with string operands, or vice-versa. [Default severity 3]

Write " !$foo && $bar || $baz " instead of " not $foo && $bar or $baz". [Default severity 4]

Use "q{}" or "qq{}" instead of quotes for awkward-looking strings. [Default severity 2]

Don't use quotes ("'", """, "`") as delimiters for the quote-like operators. [Default severity 3]

Don't write " print <<'__END__' ". [Default severity 3]

Don't use strings like "v1.4" or 1.4.5 when including other modules. [Default severity 3]

Require $VERSION to be a constant rather than a computed value. [Default severity 2]

Warns that you might have used single quotes when you really wanted double-quotes. [Default severity 1]

Write " 141_234_397.0145 " instead of 141234397.0145 . [Default severity 2]

Write " print <<'THE_END' " or " print <<"THE_END" ". [Default severity 3]

Write " <<'THE_END'; " instead of " <<'theEnd'; ". [Default severity 2]

Do not write " my $foo .= 'bar'; ". [Default severity 4]

Do not write " my $foo = $bar if $baz; ". [Default severity 5]

Ban variables that aren't blessed by your shop. [Default severity 5]

Use "my" instead of "local", except when you have to. [Default severity 2]

Avoid "$`", $&, "$'" and their English equivalents. [Default severity 4]

Eliminate globals declared with "our" or "use vars". [Default severity 3]

Use double colon (::) to separate package name components instead of single quotes ('). [Default severity 2]

Write $EVAL_ERROR instead of $@. [Default severity 2]

Do not reuse a variable name in a lexical scope [Default severity 3]

Don't ask for storage you don't need. [Default severity 3]

Prevent access to private vars in other packages. [Default severity 3]

Write "local $foo = $bar;" instead of just "local $foo;". [Default severity 3]

Write "for my $element (@list) {...}" instead of "for $element (@list) {...}". [Default severity 5]

Magic variables should be assigned as "local". [Default severity 4]

Negative array index should be used. [Default severity 4]

This is part of Perl::Critic version 1.126.

Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>

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.

2022-04-08 perl v5.32.1

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

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