ImJustAFriend has asked for the wisdom of the Perl Monks concerning the following question:
Hello, back again. I figured out how to read a remote log file with Control::CLI with a pipe so I can process the lines of the log. However, my debug line just inside the while never executes, leading me to believe the while never starts. Here's my code:
open (PRM, "-|", $NE_obj->cmd("ssh $activepilotrcs reboot ; tailer PRM +")); while (<PRM>) { print "DEBUG: $_\n"; if ($_ =~ m/.*FAILED HEARTBEAT.*/sxi) { print "$spacer $spacer $spacer $spacer Alarm Received That Act +ive Pilot Has Gone Down...\n"; } elsif ($_ =~ m/.*STARTING OA&M LEAD TRANSITION.*/sxi) { print "$spacer $spacer $spacer $spacer Standby Pilot $stdbypil +otrcs Has Started Transitioning To Active...\n"; } elsif ($_ =~ m/.*FAILOVER INITIALIZATION COMPLETED.*/sxi) { print "$spacer $spacer $spacer $spacer Standby Pilot $stdbypil +otrsc Has Transitioned To Active...\n"; $NE_output = $NE_obj->cmd("\003"); last; } else { next; } }
Am I missing something basic here? Why does my debug print line never actually print? Any thoughts on how I can get this working properly? Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Read Pipe, Never Enters While Loop
by Corion (Patriarch) on Jun 02, 2017 at 17:59 UTC | |
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 |