in reply to transliteration of a string
my $s = '\\\\10.0.0.1\\path\\to\\foo'; print("$s\n"); # \\10.0.0.1\path\to\foo $s =~ tr/\\/\//; print("$s\n"); # //10.0.0.1/path/to/foo
You can use an alternate delimiter to make things a bit more readable.
my $s = '\\\\10.0.0.1\\path\\to\\foo'; print("$s\n"); # \\10.0.0.1\path\to\foo $s =~ tr{\\}{/}; print("$s\n"); # //10.0.0.1/path/to/foo
|
|---|