Perl::Critic::Policy::Variables::ProhibitMatchVars - Avoid $`, $&, $' and their English equivalents. River stage three • 113 direct dependents • 455 total dependents

Using the "match variables" $`, $&, and/or $' can significantly degrade the performance of a program. This policy forbids using them or their English equivalents. See perldoc English or PBP page 82 for more information. It used to forbid plain "use E...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Miscellanea::ProhibitFormats - Do not use format. River stage three • 113 direct dependents • 455 total dependents

Formats are one of the oldest features of Perl. Unfortunately, they suffer from several limitations. Formats are static and cannot be easily defined at run time. Also, formats depend on several obscure global variables. For more modern reporting tool...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Modules::RequireExplicitPackage - Always make the package explicit. River stage three • 113 direct dependents • 455 total dependents

In general, the first statement of any Perl module or library should be a "package" statement. Otherwise, all the code that comes before the "package" statement is getting executed in the caller's package, and you have no idea who that is. Good encap...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Subroutines::RequireFinalReturn - End every path through a subroutine with an explicit return statement. River stage three • 113 direct dependents • 455 total dependents

Require all subroutines to terminate explicitly with one of the following: "return", "carp", "croak", "die", "exec", "exit", "goto", or "throw". Subroutines without explicit return statements at their ends can be confusing. It can be challenging to d...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Variables::ProhibitEvilVariables - Ban variables that aren't blessed by your shop. River stage three • 113 direct dependents • 455 total dependents

Use this policy if you wish to prohibit the use of specific variables. These may be global variables warned against in "perlvar", or just variables whose names you do not like....

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Subroutines::RequireArgUnpacking - Always unpack @_ first. River stage three • 113 direct dependents • 455 total dependents

Subroutines that use @_ directly instead of unpacking the arguments to local variables first have two major problems. First, they are very hard to read. If you're going to refer to your variables by number instead of by name, you may as well be writi...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::PolicyParameter::Behavior::Enumeration - Actions appropriate for an enumerated value. River stage three • 113 direct dependents • 455 total dependents

Provides a standard set of functionality for an enumerated Perl::Critic::PolicyParameter so that the developer of a policy does not have to provide it her/himself. NOTE: Do not instantiate this class. Use the singleton instance held onto by Perl::Cri...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Documentation::RequirePodAtEnd - All POD should be after __END__. River stage three • 113 direct dependents • 455 total dependents

Perl stops processing code when it sees an "__END__" statement. So, to save processing time, it's faster to put documentation after the "__END__". Also, writing all the POD in one place usually leads to a more cohesive document, rather than being for...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Subroutines::ProtectPrivateSubs - Prevent access to private subs in other packages. River stage three • 113 direct dependents • 455 total dependents

By convention Perl authors (like authors in many other languages) indicate private methods and variables by inserting a leading underscore before the identifier. This policy catches attempts to access private variables from outside the package itself...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::InputOutput::ProhibitTwoArgOpen - Write < open $fh, q{<}, $filename; > instead of < open $fh, "<$filename"; >. River stage three • 113 direct dependents • 455 total dependents

The three-argument form of "open" (introduced in Perl 5.6) prevents subtle bugs that occur when the filename starts with funny characters like '>' or '<'. The IO::File module provides a nice object-oriented interface to filehandles, which I think is ...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::NamingConventions::Capitalization - Distinguish different program components by case. River stage three • 113 direct dependents • 455 total dependents

Conway recommends to distinguish different program components by case. Normal subroutines, methods and variables are all in lower case. my $foo; # ok my $foo_bar; # ok sub foo {} # ok sub foo_bar {} # ok my $Foo; # not ok my $foo_Bar; # not ok sub Fo...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Documentation::RequirePodSections - Organize your POD into the customary sections. River stage three • 113 direct dependents • 455 total dependents

This Policy requires your POD to contain certain "=head1" sections. If the file doesn't contain any POD at all, then this Policy does not apply. Tools like Module::Starter make it really easy to ensure that every module has the same documentation fra...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Variables::ProtectPrivateVars - Prevent access to private vars in other packages. River stage three • 113 direct dependents • 455 total dependents

By convention Perl authors (like authors in many other languages) indicate private methods and variables by inserting a leading underscore before the identifier. This policy catches attempts to access private variables from outside the package itself...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::InputOutput::RequireCheckedOpen - Write < my $error = open $fh, $mode, $filename; > instead of < open $fh, $mode, $filename; >. River stage three • 113 direct dependents • 455 total dependents

The perl builtin I/O function "open" returns a false value on failure. That value should always be checked to ensure that the open was successful. my $error = open( $filehandle, $mode, $filename ); # ok open( $filehandle, $mode, $filename ) or die "u...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Objects::ProhibitIndirectSyntax - Prohibit indirect object call syntax. River stage three • 113 direct dependents • 455 total dependents

Indirect object syntax is commonly used in other object-oriented languages for instantiating objects. Perl allows this, but to say that it supports it may be going too far. Instead of writing my $foo = new Foo; it is preferable to write my $foo = Foo...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Subroutines::ProhibitReturnSort - Behavior of sort is not defined if called in scalar context. River stage three • 113 direct dependents • 455 total dependents

The behavior of the builtin "sort" function is not defined if called in scalar context. So if you write a subroutine that directly "return"s the result of a "sort" operation, then you code will behave unpredictably if someone calls your subroutine in...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Modules::RequireBarewordIncludes - Write require Module instead of require 'Module.pm'. River stage three • 113 direct dependents • 455 total dependents

When including another module (or library) via the "require" or "use" statements, it is best to identify the module (or library) using a bareword rather than an explicit path. This is because paths are usually not portable from one machine to another...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::InputOutput::RequireCheckedClose - Write < my $error = close $fh; > instead of < close $fh; >. River stage three • 113 direct dependents • 455 total dependents

The perl builtin I/O function "close" returns a false value on failure. That value should be checked to ensure that the close was successful. my $error = close $filehandle; # ok close $filehandle or die "unable to close: $!"; # ok close $filehandle; ...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::Variables::ProhibitPunctuationVars - Write $EVAL_ERROR instead of $@. River stage three • 113 direct dependents • 455 total dependents

Perl's vocabulary of punctuation variables such as $!, $., and $^ are perhaps the leading cause of its reputation as inscrutable line noise. The simple alternative is to use the English module to give them clear names. $| = undef; #not ok use English...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

Perl::Critic::Policy::BuiltinFunctions::ProhibitShiftRef - Prohibit \shift in code River stage three • 113 direct dependents • 455 total dependents

Prohibit the use of "\shift", as it is associated with bugs in Perl and its modules. Background Often, "\shift" is used to create references that act much like an alias. By creating an ‘alias’ that is named, the code becomes more readable. For exampl...

PETDANCE/Perl-Critic-1.134 - 23 May 2019 02:52:21 GMT

197 results (0.045 seconds)