Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I think, that if you rewrite this with sysread/syswrite, or, like in merlyn's solution with length-based communication, it starts working.
This may have something to do with perl's buffering, in particular, when instead of while (<>) I wrote this: it stopped hanging on close($fd). When I traced what is happening when it hangs, it looks like parent is waiting waitpid(..) (close($fd) on pipe is supposed to do that), while child blissfully unaware is running read... Now I can safely go and try to understand merlyn's code. In reply to Re^7: How to tell a child what to do?
by Eyck
|
|