system(....); if ($? == -1) { print "failed to execute: $!\n"; } #### use strict; use warnings; system('no-such-program'); print $?