my $slashes = '\\\\10.0.0.1\path\to\foo'; print "before: $slashes\n"; $slashes =~ s/\\/\//g; print "after.: $slashes\n";