I have two drivers in my PC and I am executing two perl progrmes (PrgrmA,PrgmB)from the command prompt of each drive..at the same time..

These two perl(PrgrmA,PrgmB) programes use same exes.. but there are 2 exes(Driver.exe,set.exe) which can be used by only one program (PrgrmA)at time..PrgmB has to wait untill exes (Driver.exe,set.exe) are set free..and then prgmB should start using Driver.exe,set.exe

and visa -versa.

I need a routine which moniters the existance of exes and executes the task required.

kindly some one help me..I do not have any code for the same...Waiting for positive reply from someone

After While-Loop you can place some code which will start $program_name for this process.

But be carefull!!! You shouldn't trust last print. It may lie. And I'll descrybe why. There is short time interval between last check and this print. Some concurent process can start $program_name during this interval. It is well known Race Conditions.

Basically I have two programs say A and B ..Both the programes require one exe..i,e Driver.exe to perform some tasks..but Driver.exe can be used by only one program at a time..say if Program A is using Driver.exe then Program B can not use Driver.exe..Program B can use Driver.exe only when Program A releases Driver.exe (Program A Stops using Driver.exe)