> Is there a way to get an external process's output *and* return value?
I have a program
> that opens a pipe to 'make', process all the input, and then checks
the return value when
> the loop ends (pipe is broken/closed):
>
> open MAKE, "make |" or die "Can't open MAKE pipe";
>
> while(<MAKE>) {
> # Process input
> }
> if($make_return_value) {
> # An error occured with 'make'
> }
>
> How do I get that return value?
>
Have you done the required reading, particularly:
"Using open() for IPC" in perldoc perlipc
Of course you shouldn't need open for this unless you plan to pass input
in as well, `` should work, and $? is what you are after. Check out:
perldoc -f system
For wrangling that particular nasty...
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>