in reply to How to use Labels

The issue of using lables has already been addressed, but I am wondering, why are you repeatedly trying to flock the same file, without even inspecting (and correcting!) why the lock failed?

Are you under the assumption that if the file is already locked, flock will return with a false value? Because that is not the case. flock will block until it gets the lock. It will return only in rare cases, like the OS being out of resources. Trying to lock again in a tight loop isn't going to solve that problem! The flock also fails if the filehandle isn't open, and then it will keep failing!

-- Abigail