Bisecting this was a bit tricky, but the results are that the regression was accidentally introduced in 6432a58, reported as RT#131930, and fixed in 823ba44 - the bug should therefore only exist in Perl releases v5.26.*.
#!/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.listin
+g";
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; # goo
+d
my $y = $o =~ /^main::\([^)]+\.pl:6\):\s+print;\s+#\s+6\s*$/m; # goo
+d
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?";
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|