in reply to Re: check if chdir() has work
in thread check if chdir() has work

You will want to include $! somewhere in your error message, so you'll know why chdir has failed.