in reply to Windows directory path variable binding operator substitutions
The \t in $srcDir is being interpreted as a tab character, so the replacement doesn't match (there's no tab in $path. What you need to do is use quotemeta or \Q to make it match the literal string.
$path =~ s/\Q$srcDir//i;
You die if the replacement is a false value, which it will be if it doesn't replace anything. A non-matching replacement isn't an error otherwise.
|
|---|