in reply to ftp with perl

It would really help if you would include any error messages that were produced by the script that failed. You may also want to update your original posting to format your code in a more readable fashion. Have you tried inserting any debugging statements along the way?

Are you sure that the userid/password you are using exist on the machine where it doesn't work? Are you sure that the FTP port is open on that machine, or are there any firewalls involved?

Have you thought about using a more secure transfer protocol, like scp?

No good deed goes unpunished. -- (attributed to) Oscar Wilde