Does it work 'where'? I had it bracketing the write call and added bracketing for the close statement:
sub close_child_io () { Debug "SigCHLD: close iopair[1]"; local * pipe_catch = sub ($) { Debug "Child already closed"; $iopair[1] = $iopair[0] = undef; }; my $tmp = $PathTree::iopair[1]; $PathTree::iopair[1] = undef; $SIG{PIPE}=\&pipe_catch; close($tmp); $SIG{PIPE}='DEFAULT'; };
Only the "using-TNT-to-kill-a-fly" idea of redirecting STDERR to /dev/null before every write through perl seems to shut it up:
|2588 local * write_child = sub ($) { |2589 my $out=$_[0]; |2590 return unless $iopair[1] and ref $iopair[1] and -w $iopair +[1]; |2591 |2592 local * pipe_catch = sub ($) { Debug "Child closed"; |2593 $iopair[1] = $iopair[0] = undef; }; |2594 |2595 $SIG{PIPE}=\&pipe_catch; |2596 no warnings; |2597 open (OLDERR, ">&", \*STDERR) or die "Can't dup STDERR: $! +"; |2598 open (STDERR, ">", "/dev/null") or die "Can't redirect STD +ERR to /dev/null: $!"; |2599 select STDERR; $|=1; |2600 P $iopair[1], $out."\n" ; |2601 open(STDERR, ">&OLDERR") or die "Can't restore stderr: $!" +; |2602 $SIG{PIPE}='DEFAULT'; |2603 };

In reply to Re^4: question on getting SIGPIPE in close by perl-diddler
in thread question on getting SIGPIPE in close by perl-diddler

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.