http://qs321.pair.com?node_id=1230111


in reply to Re^2: How can I read DATA in parent and child?
in thread How can I read DATA in parent and child?

The docs on fork perlfork say that parent and child share the same seek pointer:

Any filehandles open at the time of the fork() will be dup()-ed. Thus, the files can be closed independently in the parent and child, but beware that the dup()-ed handles will still share the same seek pointer. Changing the seek position in the parent will change it in the child and vice-versa. One can avoid this by opening files that need distinct seek pointers separately in the child.

So I find it surprising that this version works.