pipe($iopair[0], $iopair[1]) or
die "Failed opening pipe in start_reader: $!";
for (qw(0 1)) { select $iopair[$_]; $|=1;} #unbuffer pipe I/O
####
local * write_child = sub ($) {
my $out=$_[0];
return unless $iopair[1] and ref $iopair[1] and -w $iopair[1];
local * pipe_catch = sub ($) { Debug "Child closed";
$iopair[1] = $iopair[0] = undef; };
$SIG{PIPE}=\&pipe_catch;
P $iopair[1], $out."\n";
$SIG{PIPE}='DEFAULT';
};
####
sub close_child_io () {
Debug "SigCHLD: close iopair[1]";
my $tmp = $PathTree::iopair[1];
$PathTree::iopair[1] = undef;
close($tmp);
};
####
[#2576(PathTree::__ANON__)]Child closed
Warning: unable to close filehandle $iopair[...] properly: Broken pipe at /Users/law.Bliss/bin/lib/P.pm line 509.
####
509: unsee_ret($res);
510: }
####
local * unsee_ret;
* unsee_ret = sub ($) {
delete $p->{__P_seen} if exists $p->{__P_seen};
$_[0] };
####
do { delete $p->{__P_seen} if exists $p->{__P_seen};
$res;};