Risk-Aware AI Code Review for Business-Critical Systems
LiveReview LiveReview Explore LiveReview

Perl::Critic::Policy::ValuesAndExpressions::ProhibitEscapedCharacters - Write ""\N{DELETE}"" instead of

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

       Escaped numeric values are hard to read and debug.  Instead, use named values.  The syntax is less
       compact, but dramatically more readable.

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

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

Name

       Perl::Critic::Policy::ValuesAndExpressions::ProhibitEscapedCharacters - Write ""\N{DELETE}"" instead of
       ""\x7F"", etc.

See Also