If, on the other hand, you are talking about System V semaphores, then there is a nice IPC::Semaphore module available (I think it's even in the core).
And then reading up on semaphores in a good Unix programming book (Steven's Unix Network Progamming is my favorite) is probably a good idea.