From: Gurusamy Sarathy Date: Tue, 25 May 1999 02:24:08 +0000 (+0000) Subject: add caveat about close(PIPE) carelessness X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=73689b13b10ea0db5604b4177ed9d72f782990d1;p=p5sagit%2Fp5-mst-13.2.git add caveat about close(PIPE) carelessness p4raw-id: //depot/perl@3465 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 650493a..ed3de62 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -694,6 +694,11 @@ also waits for the process executing on the pipe to complete, in case you want to look at the output of the pipe afterwards, and implicitly puts the exit status value of that command into C<$?>. +Prematurely closing the read end of a pipe (i.e. before the process +writing to it at the other end has closed it) will result in a +SIGPIPE being delivered to the writer. If the other end can't +handle that, be sure to read all the data before closing the pipe. + Example: open(OUTPUT, '|sort >foo') # pipe to sort