my $sftp = Net::SFTP::Foreign->new($::config{'ahost'}, user => $::config{'auser'}, password => $::config{'apass'}, more => [ 'ConnectTimeout 30', 'ServerAliveInterval 20', 'ServerAliveCountMax 3' ] ); if ($sftp->error) { $self->{error} = "Unable to open SFTP connection: " . $sftp->error; return; } $self->{sftp} = $sftp;