use lib '/opt/autotree/autouser/perl_lib'; # Location of Net::FTP use strict; use Net::FTP; my $ftp = Net::FTP->new($ftp_server, Timeout => 30, Debug => 1) or die "Error: Cannot connect to FTP server $ftp_server $@\n"; $ftp->login($ftpid, $ftppwd) or die "Error: FTP Login Failed $@\n"; $ftp->cwd($ftp_file_dir) or die "Error: Unable to change to directory $ftp_file_dir $@\n"; $ftp->put($file) or die "Error: Cannot $ftp_cmd file $ftp_file $@\n"; $ftp->quit() or warn "Could not quit ftp session gracefully\n";