in reply to Re^2: net ssh loop
in thread net ssh loop
Regarding your original question, wrap the code that can fail inside eval:
eval { my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); my ($LS_OUT, $LS_ERR, $LS_EXIT) = $ssh->cmd('ls -la'); }; $@ and print "SSH failed: $@"; print "This is END where i want to see\n"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: net ssh loop
by Anonymous Monk on Jul 27, 2010 at 10:44 UTC |