See eval:
my $ssh2 = Net::SSH2->new(); my $res = eval { $ssh2->connect($server)); 1 }; if (my $err = $@) { warn "There was an error connecting to $server: $err"; };
In reply to Re: Net::SSH2 test connection to remote host
by Corion
in thread Net::SSH2 test connection to remote host
by james_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |