Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 67142
Status: new
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.114
Fixed in: (no value)



Subject: Suggested policy: forbid /o regexp flag
Download (untitled) / with headers
text/plain 748b
In the old days, you could put the /o flag on a regexp using interpolated variables to indicate it should be compiled just once. Nowadays the regexp compilation is memoized by the perl runtime, so if the interpolated string hasn't changed, there is very little speed penalty. On the other hand, /o can introduce a bug if the string *has* changed for some reason. (If you really want to get the interpolated string once and then save it for future matches, even though variables may have changed, then there are clearer ways to express this than using the /o flag.) See <http://article.gmane.org/gmane.comp.lang.perl.perl5.porters/92750> for background. Perl::Critic should have a policy at medium severity discouraging the use of /o on regexps.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.