Also remember that your program can not effect the working directory of its parent. So if you are trying to run this from a shell prompt and are expecting the current directory of your shell to be changed after your script exits, that won't work.
user@host:/mytempdir> perl -e'use Cwd; chdir("/"); print getcwd() . "\ +n";' / user@host:/mytempdir>
In the example above you can see that the chdir did work, but after the script exits the cwd is back to what it was.
In reply to Re: chdir not working
by Crackers2
in thread chdir not working
by amitrajvarma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |