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