note
haukex
<p>Bisecting this was a bit tricky, but the results are that the regression was accidentally introduced in [https://github.com/Perl/perl5/commit/6432a58ad9a504c2dc834eb0d131a10b4b6c886b|6432a58], reported as [https://github.com/Perl/perl5/issues/16119|RT#131930], and fixed in [https://github.com/Perl/perl5/commit/823ba440369100de3f2693420a3887a645a57d28|823ba44] - the bug should therefore only exist in Perl releases v5.26.*.</p>
<readmore title="bisecting script">
<c>
#!/usr/bin/env perl
use warnings;
use strict;
use Data::Dumper;
$Data::Dumper::Useqq=1;
# Run from the perl5 source tree:
# $ ./Porting/bisect.pl --start=v5.24.0 --end=v5.26.3 -- ./perl -Ilib /path/to/this.pl
# => 6432a58ad9a504c2dc834eb0d131a10b4b6c886b
# $ ./Porting/bisect.pl --start=v5.26.0 --end=v5.28.2 --expect-fail -- ./perl -Ilib /path/to/this.pl
# => 823ba440369100de3f2693420a3887a645a57d28
open my $ofh, '>', '/tmp/testdb.pl' or die $!;
print $ofh <<'END_SCRIPT';
#!/bin/perl -w
use strict;
$_ = shift // ''; # line 3
s{a([bc])} # 4
{d$1}g; # 5
print; # 6
END_SCRIPT
close $ofh;
unlink('/tmp/test.listing');
local $ENV{PERLDB_OPTS} = "NonStop AutoTrace LineInfo=/tmp/test.listing";
system($^X,'-Ilib','-d','/tmp/testdb.pl')==0 or die "\$?=$?";
my $o = do { open my $fh, '<', '/tmp/test.listing' or die $!; local $/; <$fh> };
my $x = $o =~ /^main::\([^)]+\.pl:5\):\s+{d\$1}g;\s+#\s+5\s*$/m; # good
my $y = $o =~ /^main::\([^)]+\.pl:6\):\s+print;\s+#\s+6\s*$/m; # good
my $z = $o =~ /^main::\([^)]+\.pl:5\):\s+print;\s+#\s+6\s*$/m; # bad
if ( $x && $y && !$z ) {
print "GOOD\n";
exit 0;
}
elsif ( !$x && !$y && $z ) {
print "BAD\n";
exit 1;
}
else {
print STDERR Dumper($o,$x,$y,$z);
die "What?";
}
</c>
11110568
11110568