in reply to batch query - win32

Something I've done in the past (admittedly for cron jobs but could still be applied here) is have each script set a fail flag (a zero byte size file for example) that would tell the next script to exit without running.

In script2.pl:

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); }

Then in script3.pl:

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

Replies are listed 'Best First'.
Re: Re: batch query - win32
by etcshadow (Priest) on Nov 05, 2003 at 04:51 UTC
    Why on earth wouldn't you just check the exit status of the scripts you're executing?

    ------------
    :Wq
    Not an editor command: Wq

      Well, as I mentioned, I have used fail flags for cron jobs in the past (rules out checking the exit status) and just thought I'd bring it up as something else the OP could try if so inclined. You know, TIMTOWTDI and all that :-)

      -- vek --