develooper Front page | perl.perl5.porters | Postings from July 2008

Re: Changes in m//m in 5.10

Thread Previous | Thread Next
From:
demerphq
Date:
July 10, 2008 16:11
Subject:
Re: Changes in m//m in 5.10
Message ID:
9b18b3110807101611j19da1b2bm5b30d21437a10519@mail.gmail.com
2008/6/18 Eric Brine <ikegami@adaelis.com>:
> On Wed, Dec 19, 2007 at 5:26 PM, Rafael Garcia-Suarez
> <rgarciasuarez@gmail.com> wrote:
>> On 19/12/2007, Andy Lester <andy@petdance.com> wrote:
>>> Can someone explain why this is so?
>>>
>>> $ cat test.pl
>>> my $buffer = qq{blah\nfoo\nblah};
>>> my $regex = qr/^foo/;
>>> print "Running $], ", $buffer =~ /$regex/m ? 'found' : 'not found',
>>> "\n";
>>>
>>> $ perl test.pl
>>> Running 5.008008, found
>>>
>>> $ perl510 test.pl
>>> Running 5.010000, not found
>>>
>>> ack fails its tests because of this behavior, which is what led me
>>> down this path.
>>
>> 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
>> http://rt.perl.org/rt3/Ticket/Display.html?id=22354
>> Incidentally, that was to fix this bug that $* was removed.
>
> On a related note,
>
> perlop claims "If a precompiled pattern is embedded in a larger
> pattern then the effect of 'msixp' will be propagated appropriately."
> It needs to be fixed.

What needs to be fixed? The docs?  Or the behaviour?

IMO the behaviour is right (now) and if anything should change its the docs.

Yves




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

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