Try checking the value of $?. It contains the return code of the last external command executed, but it's overloaded to contain extra information, such as the signal that killed the command and whether there was a core dump, etc.
The actual return code can be obtained through
my $return_code = $? >> 8;
If it's zero, the command executed successfully, if not, that's the error status the commadn exited with (what int main() returns with in C, for example).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…