Subject: | Module dies if connect fails |
This does NOT work:
$ssh2->connect( $host ) or die "Connection cannot be established";
because the die never occurs.
Reason: Connect method does not return anything, it just dies (because
there's a croak call in the code). Croak should be replaced with 'return
undef' or something else, which returns something and let's the calling
procedure to catch the error.