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 $?.
I added my code plus a 'close(MAKE)' right before it and it appears to work correctly. Thanks for everyone's input.
-- Andrew Gaffney Network Administrator Skyline Aeronautics, LLC. 636-357-1548
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>