in reply to Re^4: Net::SSH2 test connection to remote host
in thread Net::SSH2 test connection to remote host
relying on $@ to determine failure can trigger both false positives and false negatives
Can you explain how?
The usual way to handle errors from functions that die to signal them is:
or if you want to use the value returned by do_whatever():eval { do_whatever() }; if ($@) { # handle error ... }
I believe that the 1 usage comes from...my $res = eval { do_whatever() }; if ($@) { # handle error ... } # use $res here;
eval { do_whatever(); 1 } or print "failed!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Net::SSH2 test connection to remote host
by JavaFan (Canon) on Sep 30, 2008 at 21:20 UTC | |
by salva (Canon) on Oct 01, 2008 at 07:36 UTC | |
by JavaFan (Canon) on Oct 01, 2008 at 09:44 UTC | |
by salva (Canon) on Oct 01, 2008 at 10:30 UTC | |
|
Re^6: Net::SSH2 test connection to remote host
by kyle (Abbot) on Sep 30, 2008 at 15:53 UTC |