Andrew Gaffney wrote:
> 
> [snip]
> 
> open MAKE, "make ${makeargs} |" or die "Can't open MAKE pipe";
> while (<MAKE>) {
> 
> [snip]
> 
> }
> print "\n";
> 
> In my case, could I add this code at the end to do what I want?
> 
> if($?>>8) { # return code is non-zero
>    print "A compilation error occured. Last 15 lines of output follow:\n";
>    foreach (@buffer) {
>      print "$_\n";
>    }
> }

You have to close the MAKE filehandle first in order to get the return
value in $?.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to