Re: How to catch error (or exit) when Receive hang - WeOnlyDo Discussion board

Re: How to catch error (or exit) when Receive hang (General questions)

by woddrazen, Tuesday, November 04, 2008, 23:05 (5646 days ago) @ novanstar

Hi,


Can you please try something like this:
[code]
...
$ssh->{Timeout} = 5;
$ssh->Connect();

$ssh->WaitFor('weonlydo@linux:~$');
$ssh->Send( ls -al\n );

use Win32::OLE;
$Win32::OLE::Warn = 3;

do {
print $ssh->Receive();
} while ($@==0);[/code]
I'm not Perl guru. This worked for me but I receive in output error also.


Drazen


Complete thread: