open (PRM, "-|", $NE_obj->cmd("ssh $activepilotrcs reboot ; tailer PRM +"));
Where in the documentation of Control::CLI did you find that usage?
To me it seems that ->cmd returns a string of the command output, not a filehandle to be read from. That's also what the documentation says:
Sends a CLI command to host and returns output data
Maybe consider checking whether your open call succeeds at all:
open (PRM, "-|", $NE_obj->cmd("ssh $activepilotrcs reboot ; tailer PRM +")) or die "Couldn't open filehandle : $!";
But if you're using ssh anyway, why not run the commands directly through it?
my $output = `(ssh $activepilotrcs reboot ; tailer PRM) |`;
Or, instead, use Net::SSH::Any and use that to send the SSH commands yourself.
In reply to Re: Read Pipe, Never Enters While Loop
by Corion
in thread Read Pipe, Never Enters While Loop
by ImJustAFriend
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |