logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Affiliation

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

Author

       Chris Dolan <cdolan@cpan.org>

Configuration

       This Policy is not configurable except for the standard options.

Description

       Using the "match variables" "$`", $&, and/or "$'" can significantly degrade the performance of a program.
       This policy forbids using them or their English equivalents.  See perldocEnglish 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.

Name

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

See Also