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!
In reply to Read Pipe, Never Enters While Loop by ImJustAFriend
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |