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.
In reply to Re: Windows directory path variable binding operator substitutions
by kyle
in thread Windows directory path variable binding operator substitutions
by trout16
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |