Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Net::SSH::Perl, Net::SSH::Expect crashes script if host is unreachable

by jrsimmon (Hermit)
on Sep 11, 2009 at 21:38 UTC ( [id://794858]=note: print w/replies, xml ) Need Help??


in reply to Net::SSH::Perl, Net::SSH::Expect crashes script if host is unreachable

I had a similar problem and couldn't figure it out. The code snippet below usually works around it for my purposes:

my $retry_count = 0; while(1){ $rc = eval{$ssh->login();}; last if defined $rc; last if $retry_count >= $max_retry_count; $retry_count++; sleep 1; }
  • Comment on Re: Net::SSH::Perl, Net::SSH::Expect crashes script if host is unreachable
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2025-02-08 03:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (95 votes). Check out past polls.