This solution doesn't have anything to do with Perl, but here's how I have accomplished the same thing:
ftp -n your.destination.host <<End-Of-Session
user username password
ascii
lcd /local/directory
cd /remote/directory
prompt
mget *
bye
End-Of-Session
Brief explanation: the "-n" option with FTP allows you to automate the process and pass the username/password without having to type them in response to a prompt -- this allows me to use it in a cron job. The "prompt" statement toggles prompting mode, in this case turning it off. "mget *" gets everything in the directory on the remote server. "bye" closes the connection. I hope this helps. |