For a start, let us drop the -d test, in order to see things... See also Paladin's reply. But, there's still more going on.
Windows (and DOS) is a bit strange with regards to directories and drives: each drive has its own internal current directory. You can see it at the DOS prompt too: type cd d:\files for whatever directory that exists there, if your currently on drive C: you'll still see the path on C: as a prompt. You need to type D: to change that.
Run your script from that prompt, with C: as your current drive, and you'll see different files listed for every directory you chdir'ed to. Really.
In other Windows languages, you need to use a separate function call to change the current drive, and the current directory on a drive.
You commonly don't notice anything in Perl, because chdir (and Cwd's cwd) changes/report both drive and directory at once.
Conclusing: even in Perl, don't use "d:"; use a full path, like "d:\\" or "d:/", "d:\\files" or "d:/files".
In reply to Re: Directory path and -d??
by bart
in thread Directory path and -d??
by pen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |