in reply to Make a perl script self aware...
The device you're looking for is called a mutex.
In UNIX, you can use locks for this. Create a lock file, lock it with fcntl. If somebody's already holding the lock (your nonblocking request for a lock is denied), somebody else is already running; if it works, you're in the clear. If the process dies or exits, the OS will automatically remove the lock.
Surely Windows has a lock that works like this, or some other form of mutex.
|
|---|