Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Catching die in Net::SFTP / Net::SSH::Perl:

by salva (Canon)
on Jul 15, 2010 at 06:17 UTC ( #849707=note: print w/replies, xml ) Need Help??


in reply to Catching die in Net::SFTP / Net::SSH::Perl:

You should be able to do it using eval, what are your scoping problems?

Well, anyway, you can also use Net::SFTP::Foreign. It will not die on that kind of errors:

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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://849707]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2022-01-27 05:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (70 votes). Check out past polls.

    Notices?