print s/foo/bar/g; will print the number of changes made to $_, and $_ will be permanently modified. I'd prefer a construct that returned the modified string, which you could optionally feed back into the original variable.
Does this already exist and I just don't know about it? Or am I doomed to use temp variables for all eternity?
---
A fair fight is a sign of poor planning.
In reply to Non-destructive string substitution by Sprad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |