[Phoenix-pm] Fwd: Re: Changes in m//m in 5.10

Scott Walters scott at illogics.org
Wed Dec 19 12:30:40 PST 2007


----- Forwarded message from Rafael Garcia-Suarez <rgarciasuarez at gmail.com> -----

Date: Wed, 19 Dec 2007 22:26:51 +0100
From: Rafael Garcia-Suarez <rgarciasuarez at gmail.com>
To: Andy Lester <andy at petdance.com>
Subject: Re: Changes in m//m in 5.10
Cc: Perl 5 Porters <perl5-porters at perl.org>

On 19/12/2007, Andy Lester <andy at 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.
----- End forwarded message -----


More information about the Phoenix-pm mailing list