My first instinct would to have the first thing program.pl does be check the process list for number of instances of that prog, and exit if more than one....then you don't need to lock/unlock (and I can't think of a way to do that), just exit early.
Clare