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); }