Re: Perl Quiz of the Week #23
Mark Jason Dominus <[email protected]>
| Newsgroups | gmane.comp.lang.perl.qotw.discuss |
|---|---|
| Message-ID | <[email protected]> |
Mark Jason Dominnus: > What's happening here is that 'head' exits after printing the first > ten lines, and this closes the pipe. balanced_gen continues running, > writing data into the pipe, until the pipe becomes full. Sorry, this is mistaken. balanced_gen receives the PIPE signal as soon as it tries to write to the closed pipe. > So it probably writes about ten lines plus 8192 bytes, more or less, > and then gets prematurely terminated. So actually it gets to write one block of data to the pipe, and its second write attempt probably fails. On my system, the writes are of 4096 bytes, not 8192.