Perl 5 version 8.9
documentation

semop

Calls the System V IPC function semop to perform semaphore operations
such as signalling and waiting. OPSTRING must be a packed array of
semop structures. Each semop structure can be generated with
pack("s!3",$semnum,$semop,$semflag)
. The length of OPSTRING
implies the number of semaphore operations. Returns true if
successful, or false if there is an error. As an example, the
following code waits on semaphore $semnum of semaphore id $semid: