Subject: | IO::Pipe::End object become zombies without close() |
The IO::Pipe::End close() contains a waitpid() that collect zombies, so
the fact that Perl close() the filehandle that get out of scope isn't
sufficient to get the same behavior in the case of an IO::Pipe object
getting silently destroyed.
IO::Handle has a void DESTROY but IO::Pipe::End should have its own
DESTROY to avoid creating zombies (one of the object interface to system
resources advantage over low-level functions is that the cleaning is
automatic after all).
Just adding :
#####
# avoid zombification
sub DESTROY {
my $fh = shift;
$fh->close() if $fh->opened();
}
#####
in the IO::Pipe::End package should avoid this problem.
Is there any reason not to do that ? (performance ?)
--
Jedaï