system('db2', 'LOAD from ...'); if ($? == 0) { # all ok } if ($? & 1) { # oops, we didn't select at all? } if ($? & 2) { # just a warning } if ($? & 4) { # execution failed } if ($? & 8) { # command line processor failed } if ($? & ! 15) { # what? }