in reply to Preventing a script from running if it's already running
Check out Ensuring only one copy of a perl script is running at a time. There are lots of viable options.