Here is a simple SSCCE showing how to achieve what you have asked for.
use strict; use warnings; use Test::More tests => 1; my $have = 'http://www.myurl.com/me.html'; my $want = 'http:\/\/www.myurl.com\/me.html'; $have =~ s#/#\\/#g; is $have, $want;
Note however that I agree with haukex that under most circumstances the result which you say you want is maybe not so useful and that this does sound rather like an XY Problem.
In reply to Re^3: Appending backslash to a string
by hippo
in thread Appending backslash to a string
by garu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |