I've tried File::NFSlock, but it didn't work that well for me...It was great during my testing. But when actual workload hit it, the locking didn't detect the file as locked too many times to be useful and I ended up having messed up files.
On Solaris, I've also turned on rpc.lockd and rpc.statd. This seemed to work, except when one of the boxes crashed. It took a couple of hours and several reboots of both boxes before my sys admin was able to clear the outstanding locks.
Locking over NFS seems to be problematic at best.