open(P, "myApp |") || die "Can't create pipe: $!"; while (1) { if (isSomethingReadyToReadOnPipe(P)) { $line =

; # do stuff with output line of pipe } else { # do something else } last if eof(P); }