You have two mechanisms to detect the child ending. You can either ignore SIGPIPE signals and wait for syswrite to return 0, or you can listen for SIGPIPE signals. It's your choice. (Well, I suppose you could do both.)
As for print vs syswrite, the problem with print is that it will block until all the data is sent. If that's not desireable, the data needs be appended to a buf and sent when can_write says you can. At that point, syswrite will only send as much as it can without blocking. (Remove the chars that were sent from the buffer, and wait on can_write again).
If you do use print, make sure the file handle is flushed or auto-flushed.
In reply to Re^3: Pipes and IO::Select's method can_write()
by ikegami
in thread Pipes and IO::Select's method can_write()
by almut
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |