Ah, yes, you are right...
acts on global variables. To paraphrase Sriram Srinivasan (Author of Advanced Perl Programming), local takes the value and stores it elsewhere until the end of the block when it restores the previous value. This would most definately cause a problem with any threaded design since the file handle is global - and available to all threads. I would guess that then that the only reason your script didn't core dump sooner was pure luck (or lack there of, really). Thanks for pointing this out.