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); } #### my $script2_failflag = "/tmp/script2.failflag"; if (-e $script2_failflag) { # script3.pl should not contine any further exit(); }