if ($you_do_not_want_script3_to_run) { # create zero byte size file... open(FAILFLAG, ">/tmp/script2.failflag") || do { # handle the error here }; close (FAILFLAG); }