Today I added in support for the
> my $i = 0; say "There's more than one way".subst(/e/, { ++$i },
Th1r2's mor3 than on4 way
Previously the
Within the closure argument one can use $/, $0, $1, etc. to refer to the matched portions of the string in the replacement. Getting that to work meant that we needed to fix the binding of $/ within closures -- it turns out the mechanism we were trying to use previously (!OUTER) can't really work in Parrot. As a bonus, fixing this simplified actions.pm slightly, and removed several internal subroutine calls that were being performed at the start of each closure.
Of course, the pattern and replacement arguments to
Now we just need to verify and add a few more tests for this.
Pm
.subst now honors :g(lobal) flag 0 Comments More | Login | Reply /