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
. In the meantime, just
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!