my $file = 'c:/some/win32/path/mydir/file.txt'; my $path = 'c:/some/win32/path'; (my $file_nopath_noext = $file) =~ s/$path\/(.*)\.txt/$1/; print $file_nopath_noext."\n";This works fine but now replace forward slashes in the $file and $path variables to a backslash and it all stops working. How does one stop interpolation on the $path variable in s///? I've tried using (?{$path}) to no avail. I would prefer not to do any variable preprocessing.
In reply to how to overcome Win32 path delimiter in s///? by bsdz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |