Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Interprocess pipe doesn't reliably deliver data

by traveler (Parson)
on Mar 16, 2006 at 18:34 UTC ( [id://537239]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://537239]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-03-28 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found