Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How can I read DATA in parent and child?

by Anonymous Monk
on Feb 18, 2019 at 14:58 UTC ( #1230110=note: print w/replies, xml ) Need Help??


in reply to How can I read DATA in parent and child?

Verrrry interrrresting!

About 10 minutes' rummaging in the docs failed to find any explanation.

Some playing with the code says that what we have is a race. If you sleep in the parent before reading, the child gets the data.

Further playing says that if you seek before reading, both parent and child get the data. I was using the DATA handle directly, so my seek was
seek( DATA, tell( DATA ), 0 );.
Note that this actually works without the parentheses, but I included them for clarity.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2022-08-09 23:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?