my $cmd="dostuff.ksh"; my $res = system $cmd; if ($res != 0) { print "Job has failed\n"; }