I haven't looked at the code for Proc::Spawn, but from the symptoms you describe I would guess they are pipes; as I understand it, it is quite normal for a pipe to have a 4k buffer, and when the buffer is full the writer will block on any attempt to write more data to the pipe until the reader reads some out.
So in this case you have deadlock: the writer has written 4096 'x's to the stderr pipe, filling it, and is blocked trying to write the newline; the reader is sitting waiting for something on stdout, and there's nothing there (nor has it been closed, so there is no eof).
To avoid such deadlock you need to use nonblocking reads throughout, and be prepared to read from whichever handle has data ready, which you'd normally do with a 4-arg select loop.
You may also want to look at File::Tail which wraps up some of those details for you.
Hugo
In reply to Re: eof(FH) hanging when 4096 chars waiting on stderr (or something like that)
by hv
in thread eof(FH) hanging when 4096 chars waiting on stderr (or something like that)
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |