in reply to Re^2: Pipes and IO::Select's method can_write()
in thread Pipes and IO::Select's method can_write()
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Pipes and IO::Select's method can_write()
by sgt (Deacon) on Feb 03, 2007 at 22:27 UTC | |
|
Re^4: Pipes and IO::Select's method can_write()
by almut (Canon) on Feb 02, 2007 at 20:44 UTC | |
by ikegami (Patriarch) on Feb 02, 2007 at 21:09 UTC | |
by sgt (Deacon) on Feb 02, 2007 at 23:14 UTC | |
by tye (Sage) on Feb 02, 2007 at 23:49 UTC | |
by sgt (Deacon) on Feb 03, 2007 at 22:13 UTC | |
by ikegami (Patriarch) on Feb 04, 2007 at 21:02 UTC |