Create an Lockf instance. Always save the result in some variable(s), otherwise the lock will be released immediately.

The lock is automatically released when all the references to the Lockf object are lost. The lockf mandatory parameter can be either a string representing a filename or a reference to an already opened filehandle. The second optional parameter is a hash of boolean options. Supported options are:

ON by default. If unset, a non-blocking mode of flock is used. If this flock fails because the lock is already held by some other process, undef is returned. If the failure reason is somewhat different, permissions problems or the absence of a target file directory for example, an exception is raisen.