From: brian d foy Date: Sun, 21 Sep 2008 15:23:47 +0000 (-0500) Subject: Show using waitpid in IPC::Open[23] SYNOPSIS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b20801968f657f183ff09a100890be83a7f1337c;p=p5sagit%2Fp5-mst-13.2.git Show using waitpid in IPC::Open[23] SYNOPSIS Message-ID: <210920081523471499%brian.d.foy@gmail.com> p4raw-id: //depot/perl@34408 --- diff --git a/lib/IPC/Open2.pm b/lib/IPC/Open2.pm index ecd1e7f..65a5d8b 100644 --- a/lib/IPC/Open2.pm +++ b/lib/IPC/Open2.pm @@ -28,6 +28,9 @@ IPC::Open2, open2 - open a process for both reading and writing # or without using the shell $pid = open2($chld_out, $chld_in, 'some', 'cmd', 'and', 'args'); + waitpid( $pid, 0 ); + my $child_exit_status = $? >> 8; + =head1 DESCRIPTION The open2() function runs the given $cmd and connects $chld_out for diff --git a/lib/IPC/Open3.pm b/lib/IPC/Open3.pm index f934e89..220b945 100644 --- a/lib/IPC/Open3.pm +++ b/lib/IPC/Open3.pm @@ -26,6 +26,9 @@ IPC::Open3, open3 - open a process for reading, writing, and error handling $pid = open3($wtr, $rdr, $err, 'some cmd and args', 'optarg', ...); + waitpid( $pid, 0 ); + my $child_exit_status = $? >> 8; + =head1 DESCRIPTION Extremely similar to open2(), open3() spawns the given $cmd and