D'oh ! Not sure how I missed that. Thanks! That did the trick.
-Jason -----Original Message----- From: Steve Grazzini [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 14, 2004 12:57 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Getting return code from process launched from exec [EMAIL PROTECTED] wrote: > defined (my $pid = fork) or die "Cannot fork process : $!"; > unless ($pid){ > exec "$Command"; > die "Cannot exec : $Command : $!"; > waitpid($pid,0); > } The waitpid() is unreachable there. Try putting it outside the unless() block, so that the parent will execute it. -- Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>