in reply to system pwd
It turns out that jkahn's advice to "use Cwd;" is absolutely right -- and for my own sake, I'm glad to have learned how right it is:
As the output shown below makes clear, Cwd::getcwd always returns the true current directory:cd /home/graff perl -e 'use Cwd; $,=" "; print $ENV{PWD},getcwd,$/; chdir "/tmp"; print $ENV{PWD},getcwd,$/;'
/home/graff /home/graff /home/graff /tmp
|
|---|