in reply to Read Pipe, Never Enters While Loop
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Read Pipe, Never Enters While Loop
by ImJustAFriend (Scribe) on Jun 02, 2017 at 19:43 UTC | |
by Corion (Patriarch) on Jun 02, 2017 at 20:02 UTC | |
by ImJustAFriend (Scribe) on Jun 05, 2017 at 13:03 UTC | |
by ImJustAFriend (Scribe) on Jun 05, 2017 at 13:54 UTC |