in reply to Re: Change Working Directory in Windows!
in thread Change Working Directory in Windows!

I would not call the \docs an absolute path under Windows. Only the F:\docs and the UNC is absolute. All the rest is relative to something. F: to the current directory on the F: drive, docs to the current directory on the current drive, F:docs to the current directory on the F: drive and the \docs to the current drive.

In either the case it seems to me like the OP wanted to change the current directory of the process that started the script. Something like:

c:\some\silly\directory> perl find_something.pl params blah blah blah, I found it. c:\other\dir>
That's AFAIK not possible. Though at times would be nice.

Jenda
Enoch was right!
Enjoy the last years of Rome.

Replies are listed 'Best First'.
Re^3: Change Working Directory in Windows!
by ikegami (Patriarch) on Jan 22, 2010 at 17:48 UTC

    I would not call the \docs an absolute path under Windows

    Neither would I. That's why I didn't call it that. (Although I might under more casual circumstances.)

    In either the case it seems to me like the OP wanted to change the current directory of the process that started the script.

    Ah, could be. I assumed he tried system('cd') to change Perl's current directory. A very common mistake.

    You could achieve what you think the OP wants by using for to capture a string printed by perl, then using a pair of cd to switch to that directory (or is there a switch to change both the drive and dir now?)