Help for this page

Select Code to Download


  1. or download this
    system('some_shell_command') >> 8 and die "Failed!";
    
    ...
    if ($? >> 8 != 0) {
        die "Failed!";
    }
    
  2. or download this
    system('foobar') == 0 or die "Failed!";
    
    ...
    if ($? != 0) {
        die "Failed!";
    }
    
  3. or download this
    if ($? == -1) {
        print "failed to execute: $!\n";
    ...
    else {
        printf "child exited with value %d\n", $? >> 8;
    }