Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Interprocess pipe doesn't reliably deliver data

by traveler (Parson)
on Mar 16, 2006 at 18:34 UTC ( #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? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2022-01-19 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (55 votes). Check out past polls.

    Notices?