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.
In reply to Re^3: How can I read DATA in parent and child?
by hdb
in thread How can I read DATA in parent and child?
by Skeeve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |