Perl::...chVars(3pm)
okay bestie, welcome to Perl::...chVars(3pm) β a page from the User Contributed Perl Documentation, and it's here to keep your match variables from tanking your program's vibe. no cap, this one's short but the performance warning is real π
πΈ NAME πΈ
Perl::Critic::Policy::Variables::ProhibitMatchVars β avoid $`, $&, $' and their English equivalents. periodt.
π AFFILIATION π
This Policy is part of the core Perl::Critic distribution. iconic core behavior β¨
β¨ DESCRIPTION β¨
Okay so using the "match variables" $`, $&, and/or $' can significantly degrade the performance of a program. not joking π This policy forbids using them or their English equivalents. For the tea, see perldoc English or PBP page 82. π
Back in the day it used to forbid plain use English; because it ends up causing the performance side-effects of the match variables. the more you know π¦ 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. slay, targeted fix β
π CONFIGURATION π
This Policy is not configurable except for the standard options. so don't try to customize it, bestie π
π¦ AUTHOR π¦
Chris Dolan <cdolan@cpan.org> π
π COPYRIGHT π
Copyright (c) 2006-2011 Chris Dolan. respect the OG π
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. legal but make it cute π«Ά
and that's the whole page, bestie β this iconic manual page is Perl::...chVars(3pm), sourced from perl v5.42.0 and dated 2024-10-23. go off and keep your match variables out of your code, fr fr π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Perl-Critic 1.156.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms