use strict; use warnings; # ... chdir('/path/to/put/files/in'); system('ftp', '-N', 'mystartfile', 'ftp.server.com') && die "FTP FAILURE: $!\n"; chdir('/where/I/was/before'); # ...