On Tue Jan 10 01:08:49 2012, ikegami@adaelis.com wrote: > On Mon, Jan 9, 2012 at 10:56 PM, Adam Thomason <perlbug- > followup@perl.org>wrote: > > > The escaping code on line 376 was introduced in 4ab99479, without > > particular > > comment to its necessity. Removing it doesn't break DD's test suite, > but > > it's quite possible it breaks something else, perhaps an older perl > which > > stringifies regexes differently. > > > > Some escaping of "\" is needed even on latest Perl. > > >perl -MData::Dumper -E"$r=qr(\/); say $r; print Dumper($r);" > (?^u:\/) > $VAR1 = qr/(?^u:\\/)/; # XXX > > >perl -MData::Dumper -E"$r=qr(/); say $r; print Dumper($r);" > (?^u:/) > $VAR1 = qr/(?^u:\/)/; # Ok, but would break if you remove the > escaping. > > Dumper needs to add "\" in front of "/" unless its preceded by an odd > number of "\": > > $pat =~ s,/,\\/,g; > > Needs to be something like > > $pat =~ s,(?<!\\)(?:\\\\)*\K/,\\/,g; I somehow missed this message. That’s five times the speed of the pattern I used in de5ef703c. But unfortunately it won’t work on older perls. I doubt it’s worth the complexity of conditionally compiling a regexp, as the XS version is used mostly. -- Father Chrysostomos --- via perlbug: queue: perl5 status: resolved https://rt.perl.org:443/rt3/Ticket/Display.html?id=58608Thread Next