system("program -a arg1 -b arg2"); $exit_val = $? >> 8; # or divide by 256 if you like