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 (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