Perl: flock()
flock()
The flock function requests a lock on a filehandle
It takes two arguments: the filehandle and the lock mode
The mode can be:
1 Shared lock - for reading2 Exclusive lock - for writing5 Non blocking shared lock6 Non blocking exclusive lock