Perl::Critic::Policy::Variables::ProhibitMatchVars - Avoid C<$`>, C<$&>, C<$'> and their English equivalents.


Perl-Critic documentation  | view source Contained in the Perl-Critic distribution.

Index


NAME

Top

Perl::Critic::Policy::Variables::ProhibitMatchVars - Avoid $`, $&, $' and their English equivalents.

AFFILIATION

Top

This Policy is part of the core Perl::Critic distribution.

DESCRIPTION

Top

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 English; because it ends up causing the performance side-effects of the match variables. However, the message emitted for that situation was not at all clear and there is now Perl::Critic::Policy::Modules::RequireNoMatchVarsWithUseEnglish, which addresses this situation directly.

CONFIGURATION

Top

This Policy is not configurable except for the standard options.

AUTHOR

Top

Chris Dolan <cdolan@cpan.org>

COPYRIGHT

Top


Perl-Critic documentation  | view source Contained in the Perl-Critic distribution.