develooper Front page | perl.perl5.porters | Postings from May 2007

Bug in IO::Pipe

From:
Alain Williams
Date:
May 31, 2007 04:16
Subject:
Bug in IO::Pipe
Message ID:
20070531091005.GR5187@mint.phcomp.co.uk
Hi,

I just fell over a problem in IO::Pipe - the documentation needs to be a little clearer.

Take the code:

	my $h = IO::Pipe->new or die("can't create pipe");
	$h->reader('pwd');
	my $line = <$h>;
	print "read: '$line'\n";
	close($h);

Which was my first cut in a long running perl script.
This accumulated hundreds of children, if I replace the close($h) by:

	$h->close;

the child processed are reaped correctly.

It may be an idea to add a comment about this in the documentation to warn others
about the pitfall.

If you wish I could submit a patch.

Cheers

-- 
Alain Williams
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
#include <std_disclaimer.h>



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About