Say I have the following in perl:
my $string; $string =~ s/ /\\\\ /g; $string =~ s/\'/\\\\\'/g; $string =~ s/`/\\\\`/g;
Can the above substitut
Separate substitutions may be much more efficient than a single complex one (e.g. when working with fixed substrings). In such cases you can make the code shorter, like this:
my $string; for ($string) { s/ /\\ /g; s/'/\\'/g; s/`/\\`/g; }