Perl::Critic::Policy::RegularExpressions::ProhibitUnusualDelimiters - Use only C or C<{}> to delimit regexps.


Perl-Critic documentation  | view source Contained in the Perl-Critic distribution.

Index


NAME

Top

Perl::Critic::Policy::RegularExpressions::ProhibitUnusualDelimiters - Use only // or {} to delimit regexps.

AFFILIATION

Top

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

DESCRIPTION

Top

Perl lets you delimit regular expressions with almost any character, but most choices are illegible. Compare these equivalent expressions:

  s/foo/bar/;   # good
  s{foo}{bar};  # good
  s#foo#bar#;   # bad
  s;foo;bar;;   # worse
  s|\|\||\||;   # eye-gouging bad




CONFIGURATION

Top

There is one option for this policy, allow_all_brackets. If this is true, then, in addition to allowing // and {}, the other matched pairs of (), [], and <> are allowed.

CREDITS

Top

Initial development of this policy was supported by a grant from the Perl Foundation.

AUTHOR

Top

Chris Dolan <cdolan@cpan.org>

COPYRIGHT

Top


Perl-Critic documentation  | view source Contained in the Perl-Critic distribution.