in reply to Current Directory in Windows
Maybe this will help you?
c:\>type test\junk.pl print $^X, "\n", $0; c:\>perl test\junk.pl C:\Perl64\bin\perl.exe test\junk.pl
If you extract the path from $^X that will tell you where the executable (perl.exe) was run from.
And if you add the path component from $0 the cwd, that will tell you where the script was run from.
There are probably some exceptional circumstances where one or other of those won't be true, but they are rare enough to discount for most purposes.
|
|---|