in reply to Interprocess pipe doesn't reliably deliver data

Your later data is hidden because
if ($::i++ == 10) { my $a = <STDIN>; print "ALSO READ: $a\n";
is only executed once. Either set $i back to 0 or use (++$i %10) which allows it to print more times.

Replies are listed 'Best First'.
Re^2: Interprocess pipe doesn't reliably deliver data
by fhew (Beadle) on Mar 16, 2006 at 18:40 UTC
    My latter data was supposed to be picked up by the can_read(). The 'ALSO READ' statement was just a debug statement (only) to prove that the data really was in the pipe. I can't have the <STDIN> because that would block my system when the pipe was empty... thats why I was using can_read().
      Yes, but you need to run the debug more than once. You also need to completely empty the buffer each time you read. Changing to a sysread in a while loop will fix that, as suggested above.