if you need to keep the original value you can do$file2 = param('file'); # A windows path is supposed to be filled h +ere (c:/foo/bar.txt) $file2 =~ s%\\%/%g; # It's not too late to substitute here. $file2 =~ s%.*:%%; # also cut off c: print "$file2\n"; # c:foobar.txt is printed
($file3 = $file2) =~ s%what%ever%g;
In reply to Re: / to \ substitution
by zodiac
in thread / to \ substitution
by NeverMore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |