Did you try that?
The /r modifier (Perl 5.14) only solves one of the problems (it doesn't alter the original). It doesn't solve the second problem that the $_ =~ s/a/X/gr construct is not being evaluated in list context, and therefore returns the number of substitution matches, not the modified string.
Apparently I didn't. ;) -- lousy excuse in a followup node below.
Dave
In reply to Re^3: map and regexp. An newbie question
by davido
in thread map and regexp. An newbie question
by nando
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |