List Info

Thread: Bug in IO::Pipe




Bug in IO::Pipe
user name
2007-05-31 04:10:05
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>

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )