in reply to chdir not working

How about you quit with the guessing and just use the return value of the chdir function and the $! variable in string context.
$ perl -e 'chdir "no existant directory" or die "chdir failed: $!\n"'

Which outputs this helpful message;

chdir failed: No such file or directory