I have problem with using flock in my program. It doesn't lock the file even though I use LOCK_EX (2). I invoked the progran twice and both instances locked the file sucessfully (I expect one to fail) but neither one can unlock the file. I think my system support BSD otherwise I would had a fatal error. I also tried to look into lockf but have no idea how to use it in perl. Any idea?
ps. The file I try to lock is not on NFS and is local to the machine.