The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 08-22-2007
jjinno jjinno is offline
Registered User
 

Join Date: Jul 2007
Location: Cloud 9
Posts: 70
Piped open not real-time - How would one handle live data?

When I run "/etc/myApp" I am presented with continuous output, just about once per second.

However when I try to get the information in Perl via a piped open, it waits till the end to give me anything... my code:
Code:
open (OUTPUT,"/etc/myApp |");
    while (<OUTPUT>){
        print $_;
    }
close (OUTPUT);
Why is that, and how can I fix it so that I do get the progressive output?

I know that I can solve my particular problem by just pushing STDOUT to a temp file, and then parsing it... but I would prefer to learn how to handle "live" data
Reply With Quote
Remove advertisements
!!
Forum Sponsor