in reply to Multiple replacements with the exception of previously made replacements.
Is there any way to achieve this with a single s/// operation?
How about with zero s/// operations? (Use tr/// instead :)
[0] Perl> $s = 'x x x a x x x b x x x a x x x b x x x';; [0] Perl> $s =~ tr[ab][ba];; [0] Perl> print $s;; x x x b x x x a x x x b x x x a x x x
|
|---|