Steve Fink wrote:
In debugging a regex problem, I gradually whittled a test case down to
the following code. It does roughly:
@a = ('aaa', 'ac');
$x = $a[0];
print $x;
$x = substr("aaacacaaba", 3, 3); # "cac"
$y = $a[0]
print $y;
and prints out
aaa
cac
This is my illegal speed hack
In debugging a regex problem, I gradually whittled a test case down to
the following code. It does roughly:
@a = ('aaa', 'ac');
$x = $a[0];
print $x;
$x = substr("aaacacaaba", 3, 3); # "cac"
$y = $a[0]
print $y;
and prints out
aaa
cac
So the substr is somehow modifying the first eleme