in reply to Re^5: Pipe Problem
in thread Pipe Problem

Thanks. That probably explains it. So the work around is to have the C program prints out 1024 bytes or so on each line. After all these times, I am surprised that no one has found a better solution for this.

Replies are listed 'Best First'.
Re^7: Pipe Problem
by graff (Chancellor) on Jul 23, 2007 at 03:24 UTC
    If output buffering is turned off in the C program, there should be no need to pad the output.

    Regardless of the presence/absence of "flush()" in the C program, if it is not putting a "\n" at the end of each output iteration, and you don't tailor your perl script to handle its input in some specialized, non-default manner (e.g. by changing the value of the input record separator "$/"), the addition of padding at each output iteration won't help at all.

    So don't pad the output, because it's pointless to do that.