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'; };