develooper Front page | perl.perl5.porters | Postings from December 2007

Re: Changes in m//m in 5.10

Thread Previous | Thread Next
Andy Lester
December 22, 2007 17:52
Re: Changes in m//m in 5.10
Message ID:

On Dec 22, 2007, at 6:13 PM, Chris Dolan wrote:
> 2) Perl::Critic has been recommending /m on all regexes since 0.13,  
> so lots of people have adopted this habit.

Perl::Critic users, and indeed PBP readers, is a very small subset of  
Perl users.

My only concern is the user who does this:

   my $re = qr/something/;
   if ( $str =~ /$re/m )...

and has no idea why it doesn't work.  That user is the one we must pay  
the most attention to.  If there's some way to let him know that his  
invocation of the regex is wrong, I'd love to hear it.

I can't imagine that I'm the only one out there in the universe of  
Perl users who's been writing regexes like that incorrectly,  
accidentally taking advantage of this now-fixed bug.  If I'd had a  
warning like that since I started using regex objects, I'd never have  
gotten into the bad habit.


Andy Lester => => => AIM:petdance

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About