Checking my copy of Stevens APUE my reading (and vague recollections of actual behavior) confirms this; you're not going to get SIGPIPE until you actually write to the fd the child's closed. The SIGCHLD should be the first sign you get.

use IPC::Run qw( start pump ); use Log::Log4perl qw( :easy ); Log::Log4perl->easy_init($DEBUG); $SIG{$_} = eval qq{sub{INFO qq{Got $_}; 1}} for qw(CHLD PIPE); INFO q{Starting}; my $in=q{}; my $chld = start(["bash","-c","sleep 5"],q{<},\$in); ## This will get CLHD and sleep will exit early INFO q{Sleeping}; my $r=sleep(10); WARN( qq{$r, $!} ); ## This will trigger PIPE $in .= qq{FOO}; pump $chld; ## This won't be reached. INFO q{Done} __END__ 2021/01/13 15:07:42 Starting 2021/01/13 15:07:42 Sleeping 2021/01/13 15:07:47 Got CHLD 2021/01/13 15:07:47 5, Interrupted system call 2021/01/13 15:07:47 Got PIPE ack Broken pipe: write( 6, 'FOO' ) at ....

The cake is a lie.
The cake is a lie.
The cake is a lie.


In reply to Re^2: Detect whether a writeable filehandle has closed? by Fletch
in thread Detect whether a writeable filehandle has closed? by jdporter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.