in reply to Changing directory in cmd window

I'm pretty sure the answer is "you can't" change directory and have it remain in effect after your script ends.

Depending on why you're trying to do that, perhaps there is a way to spawn a command prompt from inside your perl process, thus keeping the context. I'm not an expert on Windows so someone else will have to tell you the best way to do that - looks like someone has already.

Hope this helps.