in reply to unable to change remote directory

When you try say:

chdir($d) or die "error: cd '$d' failed: $!";

What does $! tell you is the matter?