I'm working on some perl code that runs in a vareity of environments. In some cases, the files it needs to modify are on a local hard disk. In other cases, they are on an NFS mount. Since the script spawns multiple children that sometimes might try to modify a file at the same time, I need to implement some kind of file locking so they don't step on each other's toes. I've always read the flock() won't work over NFS. The key here, though, is that the script has no way of knowning whether the files it's working with are local or NFS-mounted. Is there something like flock() that will work regardless of whether the files are local or not?