in reply to Re^2: Call external script via ssh with Control::CLI, get output to calling script window
in thread Call external script via ssh with Control::CLI, get output to calling script window
You can use polling mode on cmd() if you set Blocking to 0
So you could do this:
$s1_cli->cmd( Command => "/path/to/pre-loader.pl arg1 arg2 2>&1", Blocking => 0 ); do { Time::HiRes::sleep 0.2; ($ok, $output) = $s1_cli->cmd_poll; print $output if length $output; } until $ok;
Or else this:
$s1_cli->cmd( Command => "/path/to/pre-loader.pl arg1 arg2 2>&1", Blocking => 0 ); $s1_cli->poll( Poll_code => sub { $output = ($s1_cli->cmd_poll)[1]; print $output if length $output } );
|
|---|