if (! ($ftp->put($location.$fileName)) ) { &Logs(":Error:","Could not PUT file $fileName from $location to $ftpHost"); die &SendFailEmail("Error with transferring $fileName to $ftpHost",$notificationEmail); } #### my $host = $ftpHost; my %args = ( user => $userName, password => $password, debug => 'true', ssh_args => [port => 22], ); if (! ($ftp = Net::SFTP->new($host, %args)) ) { &Logs(":Error:","Could not login to FTP $location $ftpHost"); die &SendFailEmail("Error with connecting to $ftpHost",$notificationEmail); }