in reply to Problem in System function

from perldoc -f system...

You can check all the failure possibilities by inspecting
$? like this:

    $exit_value  = $? >> 8;
    $signal_num  = $? & 127;
    $dumped_core = $? & 128;