in reply to Re: Chaining string ops
in thread Chaining string ops

Could we not have it both ways? After all, this is perl....

if ($s =~ s/change/me/)
$str = "some string" =~ s/a/b/r =~ s/foo/bar/r

where /r is the newly created "chaining" modifier that forces a /r/eturn of the new string. Make it have no side effects either (ie. not touch the original string), and it'd fill a need.

Update: changed /c to /r, seeing as /c is taken.