in reply to perl hangs on write syscall
In any case, what's probably happening is that whatever is attached to the other side of file descriptor 4 (a pipe?) is not handling the data.