in reply to Keeping a script from going on before a sub is done

Or you could use a semaphore file: when finished, the sub-procedure places a file somewhere at an agreed place and the main program watches until the file appears and then does the clean-up (including deleting the semaphore file).

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics
  • Comment on Re: Keeping a script from going on before a sub is done

Replies are listed 'Best First'.
Re^2: Keeping a script from going on before a sub is done
by Anonymous Monk on Jun 25, 2012 at 13:08 UTC
    Thanks, this looks like a promising idea :-) Actually, I think I might even have files I can use as semafores. I only need to restructure the script...