Good question. In Perl, this is difficult since the Threads.pm muteces are exactly what's holding PerlThreads back in the stone age. I'm working on a fake mutex that uses flock on some file. Read more about the difficulties with
flock here. In the meantime, just
flock the library or some arbitrary file everytime you wish to access the file. Keep in mind that this defeats any use of threads within that library- only one thread at a time may access it and your thread stacks may expand greatly. I'll keep you posted on my own efforts as well. Good luck!
AgentM Systems nor Nasca Enterprises nor
Bone::Easy nor Macperl is responsible for the
comments made by
AgentM. Remember, you can build any logical system with NOR.