in reply to Re^2: Can we make $& better? (need)
in thread Can we make $& better?
The solution to the copy problem is to use m//g in scalar context which will NOT copy the string, and WILL result in the special match vars returning incorrect results if the string is changed after the fact.
And yes, we did discuss some other options to control this behaviour, its just i never got around to dealing with them and now its too late for 5.10. Sorry about that.
BTW, due to a misconception on my part I was extremely reluctant to add new modifiers. Im now much less reluctant as I resolved the misconception. The misconception was that adding new modifiers would break loads and loads of stuff, but further analysis proved that this was an unfounded concern.
$world=~s/war/peace/g
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Can we make $& better? (need)
by tye (Sage) on Sep 12, 2007 at 19:12 UTC | |
by demerphq (Chancellor) on Sep 12, 2007 at 19:24 UTC | |
by tye (Sage) on Sep 12, 2007 at 20:49 UTC |