in reply to [SOLVED] Capture the make status

make should pass through the last exit status to system, or should exit itself with some status that indicates error.

Have you looked at system and how one can catch the exit status of a subprocess? I would look at autodie, which is available with recent versions of Perl, or at the following idiom:

system( $cmd ) == 0 or die "Couldn't launch/run [$cmd]: $? / $! / $^E";

Replies are listed 'Best First'.
Re^2: Capture the make status
by baxy77bax (Deacon) on Aug 26, 2013 at 12:00 UTC
    well then i am doing something else wrong because when i induce an error my system returns 0 as if everything is ok...

      Aaaah - sorry! Now I realize your command line, and where that behaviour stems from.

      You are not passing a single command to system() but a string containing ";" which will be interpreted by the shell instead of directly started. You get back the exit status of the shell, which (likely) is the exit status of the last command run, which is cd ...

      I recommend you do the chdir in Perl and run only make ... directly via system().