Here are the pros and cons of the DBM file-locking wrappers available from CPAN:
On some operating systems (FreeBSD, for example), it is possible to lock on tie:
tie my %t, 'DB_File', $DBM_FILE, O_RDWR | O_EXLOCK, 0664;
and release the lock only by untying the file. Check if the O_EXLOCK flag is available on your operating system before you try to use this method!
Copyright © 2003 O'Reilly & Associates. All rights reserved.