use strict; my $t = 'c:\tmp/sup'; print "$t\n"; $t =~ s?\\|/?\\\\?g; print "Modified\n$t\n";
You need the \\ to match a single \ and a \\\\ to change it to a \\.
Also by using a character other than the / for your delimeter you don't have to escape it in the regex. I find that's a bit cleaner to read without all the escaping.
Hope that helps!
There is no emoticon for what I'm feeling now.
In reply to Re: substitution
by Popcorn Dave
in thread substitute \ and / with \\ ?
by kirk123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |