Perl::...racters(3pm)

πŸŽ€ Perl::Critic::Policy::ValuesAndExpressions::ProhibitEscapedCharacters(3pm) πŸŽ€

So this is a page from the User Contributed Perl Documentation (perl v5.42.0, dated 2024-10-23, bestie, write it down), and it's about a Perl::Critic policy with the most extra name ever: Perl::Critic::Policy::ValuesAndExpressions::ProhibitEscapedCharacters. Basically: write "\N{DELETE}" instead of "\x7F", etc. πŸ’…


✨ NAME ✨

Perl::Critic::Policy::ValuesAndExpressions::ProhibitEscapedCharacters β€” literally the policy that tells you to write "\N{DELETE}" instead of "\x7F", etc. πŸ¦‹

🌸 AFFILIATION 🌸

Okay so this Policy is part of the core Perl::Critic distribution. It comes with the package, no extra install drama. πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

Escaped numeric values are hard to read and debug. Like, genuinely. Not me squinting at \x7F trying to remember what that even is 😭. Instead, use named values. The syntax is less compact, but dramatically more readable. It's giving "a little more typing, a whole lot more brain cells saved".

$str = "\x7F\x06\x22Z";                         # not ok

use charnames ':full';
$str = "\N{DELETE}\N{ACKNOWLEDGE}\N{CANCEL}Z";  # ok

See? The second one actually says what it means. Main character energy. πŸ”₯

🧚 CONFIGURATION 🧚

This Policy is not configurable except for the standard options. That's it, that's the whole vibe check. No knobs, no dials, no [ValuesAndExpressions::ProhibitEscapedCharacters] customization arc for you. 🫢

⭐ AUTHOR ⭐

Chris Dolan <cdolan@cpan.org> β€” thank you icon, we appreciate you. πŸ™ˆ

Copyright (c) 2006-2011 Chris Dolan.

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. πŸ“œ


fr fr, that's the whole page β€” no cap, nothing skipped. πŸ’œ

mwah, hope you slayed that read-through β€” this was perl v5.42.0, last touched 2024-10-23, from the User Contributed Perl Documentation, and you're officially a ProhibitEscapedCharacters girlie now πŸŽ€βœ¨

πŸ“¦ where this page comes from