in reply to how to use semaphores?

You would do better looking up references for Unix IPC (inter-process communications) than asking a Perl community, knowledgeable though it may be.