Subject: | IO::Pipe::End object become zombies without close() |
MIME-Version: | 1.0 |
X-Mailer: | MIME-tools 5.418 (Entity 5.418) |
Content-Type: | text/plain; charset="utf8" |
Content-Disposition: | inline |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | utf-8 |
Content-Length: | 713 |
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ï