develooper Front page | perl.perl5.porters | Postings from January 2009

Re: perldelta omission for 5.8.9?

Thread Previous
From:
Bram
Date:
January 28, 2009 15:09
Subject:
Re: perldelta omission for 5.8.9?
Message ID:
20090129000759.gjwkl7wg2as8804g@horde.wizbit.be
Citeren Bram <p5p@perl.wizbit.be>:

> Citeren Ricardo SIGNES <perl.p5p@rjbs.manxome.org>:
>
>>
>> I forgot about how dramatically more useful qr{} became once qr{}m worked
>> properly, as demonstrated by this code:
>>
>>  use strict;
>>  use Test::More 'no_plan';
>>
>>  my $string = "Subject: Hello Jimbo Johnson\x0ADate: whatever";
>>
>>  like($string, '/(?m:^Subject: Hello Jimbo Johnson$)/', "q{//}",);
>>  like($string, qr{(?m:^Subject: Hello Jimbo Johnson$)}, "qr{(?m:...)}",);
>>  like($string, qr{^Subject: Hello Jimbo Johnson$}m,     "qr{}m",);
>>
>> This was fixed in 5.010, but it looks like the fix made it back into 5.8.9
>> (which is great!) but was not documented, going by
>> http://perldoc.perl.org/5.8.9/perldelta.html
>
> I hope it isn't fixed in 5.8.9 since it is not backwards compatible.
> (As in, it behaves differently.)
>
>
>> Am I mistaken, or is this an omission to fix in some mythical 5.8.10?
>
> There does seem to be a different in behaviour between 5.8.8 and 5.8.9
> but note that it does not behave the same as 5.10.0.
>
> The following prints "not ok" on 5.8.8/5.8.9 and "ok" on 5.10.0 (the
> behaviour in 5.10.0 is the 'correct' one):
>
>   my $string = "Subject: Hello Jimbo Johnson\x0ADate: whatever";
>   my $re = qr{^Subject: Hello Jimbo Johnson$};  # no /m
>   print $string !~ /$re/m ? "ok" : "not ok"; # shouldn't match since
> $re didn't had /m

Did some binary searching:

In blead the behaviour changed with:

http://public.activestate.com/cgi-bin/perlbrowse/p/23471
Change 23471 by rgs@valis on 2004/11/04 09:26:56

	Subject: [PATCH blead] [perl #3038] Re: $qr = qr/^a$/m; $x =~ $qr; fails
	From: Rick Delaney <rick@bort.ca>
	Date: Sun, 31 Oct 2004 22:40:40 -0500
	Message-ID: <20041101034040.GC1232@biff.bort.ca>


In maint-5.8 the behaviour changed with:

http://public.activestate.com/cgi-bin/perlbrowse/p/27604
Change 27604 by nicholas@nicholas-saigo on 2006/03/25 15:15:28

	Integrate:
	[ 23471]
	Subject: [PATCH blead] [perl #3038] Re: $qr = qr/^a$/m; $x =~ $qr; fails
	From: Rick Delaney <rick@bort.ca>
	Date: Sun, 31 Oct 2004 22:40:40 -0500
	Message-ID: <20041101034040.GC1232@biff.bort.ca>

Also of interest:

http://rt.perl.org/rt3//Public/Bug/Display.html?id=3038



Thread Previous


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