in reply to unable to change remote directory
When you try say:
chdir($d) or die "error: cd '$d' failed: $!"; [download]
What does $! tell you is the matter?