in reply to Moving files and directories

Inside of double quotes, backslashes need to be escaped. Try my $inDir = "M:\\AllFiles" (and correcting other backslashes as well).

Note that if you had use warnings; at the top of the script, you'd see errors like "Unrecognized escape \A passed through at line 8" which would be a flag indicating a potential problem.