I have the following script structure: script A opens PIPE on B, and B opens PIPE on C. So the dataflow is A->B->C. B catches SIGPIPE. Though descriptors IN and OUT are opened:
$SIG{'PIPE'} = sub {
$logger->info('caught PIPE signal.');
$logger->info("STDIN status: ".STDIN->opened());
$logger->info("STDOUT status: ".OUT->opened());
die;
};
STDIN status: 1
STDOUT status: 1
I have added IN to the $pool IO::Select and when IN is in the $pool->can_read(), I read from it with sysread(). Once a second I write to OUT with print. Also I have a listen socket in the $pool and clients can connect to it. But I only read from clients. I'm writing to OUT only.