As others have said and as you have discovered, things like fuser and lsof only work on the local machine, which leaves you the option of using voluntary locks. Voluntary locks don't do what you need unless everyone who touches the file makes use of them.
But, for your purposes, is it enough to know whether or not the file has been accessed recently? If so, you could use the last access time from stat:
@_ = stat("thefile");
$how_recently = time-$_[8];
(Some filesystems are mounted without the option for keeping track of the last access time.) |