my $script2_failflag = "/tmp/script2.failflag"; if (-e $script2_failflag) { # script3.pl should not contine any further exit(); }