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

Re: Changes in m//m in 5.10

Thread Previous | Thread Next
From:
Andy Lester
Date:
December 22, 2007 17:52
Subject:
Re: Changes in m//m in 5.10
Message ID:
F79646C5-0906-4EF2-9083-09F99A03D56E@petdance.com

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.

xoa

--
Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance





Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About