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

Re: Changes in m//m in 5.10

Thread Previous | Thread Next
December 19, 2007 14:11
Re: Changes in m//m in 5.10
Message ID:
On 19/12/2007, Andy Lester <> wrote:
> On Dec 19, 2007, at 3:26 PM, Rafael Garcia-Suarez wrote:
> > The effect of /m is no longer global, but it now only affects the
> > regexp it was applied to. No more unwanted side effects! See bug
> >
> > Incidentally, that was to fix this bug that $* was removed.
> So really, all this time the /m should have gone on the qr//, not on
> the m/$regex/ ?

Yes. Although it wasnt clear to me straight away. :-)

Although, IMO its an arguable case slightly in this case due to there
not being anything else in the pattern. If there was anything else
involved in the pattern then the situation would be clear that 5.10 is
correct. With the bare pattern however its arguable that we could
check the modifiers on the m// and see if they match that of $regex
and recompile if not. This would be DWIM but would also negate most of
the point of using qr//.

Probably it would be better to simply warn "Useless use of modifiers
on m/// at line ...".

perl -Mre=debug -e "/just|another|perl|hacker/"

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