in reply to Re^2: net ssh loop
in thread net ssh loop

First, to include code in your posts use <code>your code here</code>, there is a backslash in the closing tag!

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
    Hi, create, it works thanks. -jho