in reply to Pipe Input delayed

The java programUnlike the java program, read_serial.pl is buffering its output.

Possible solutions:

Update: Ah! Read it backwards! It's when using a Perl child that it didn't work.

Replies are listed 'Best First'.
Re^2: Pipe Input delayed
by yodha (Initiate) on Jun 28, 2011 at 20:57 UTC
    Thanks ikegami. I disabled buffering on my perl script with
    select((select(STDOUT), $| = 1)[0]);

      That doesn't disable buffering, it just enables auto-flush on the selected filehandle.

        Same thing.
        Ah! Thanks for making it clear

      Telling Perl not to buffer STDOUT is not useful since the problem is that the java program is buffering its output.

      Update: Ah! Read it backwards! It's when using a Perl child that it didn't work.