in reply to remote directory structure

Couple of different options: Expect.pm, with a raw telnet into the box. Not real secure for the remote user, IMHO.

OR

Write a cgi for the remote box that basically does this:
print "Content-type:text/html\n\n"; opendir (D,".") || die "$!"; print join ("\n",(sort {$a cmp $b} grep !/^\.\.?$|$0/, readdir D)); close(D);
Put the CGI on the remote machine, and just parse the HTTP response into an array to get the dirlisting. If this needs to be recursive on the remote machine, checkout File::Find.