Re: [BUG] substr messing up array elt

2003-01-24 Thread Leopold Toetsch
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

[BUG] substr messing up array elt

2003-01-24 Thread Steve Fink
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