People learn a lot more by being shown the why of something than from just being hit upside the head and told not to do it, no matter how experienced the person doing the hitting.
No, you're missing the purpose of my "don't do this" post.
Going back to the innoculation metaphor, I'm providing emergency-room treatment. Surely, this is not a substitute for a person going out to learn how to avoid catching communicable diseases. That happens later (or hopefully earlier).
Getting back to the literal issue here, I'm just saying "stop, don't". And that's a first round of response. But I'm not about to quote the plenty existing literature about why the solution is broken. If there was something not well known about why the solution is broken, I'd have provided more pointers. If you review my posts, you'll see that I've done that frequently.
But knowing that you have to do an atomic operation to provide a lock is fairly basic knowledge. And as I showed in my google reference, the first dozen hits for "perl lock" were all quite informed, so there's almost no excuse for the code that triggered my outburst, except that this is a KLB (in #perl parlance) and will likely lead others astray unless muzzled until they get a clue.
-- Randal L. Schwartz, Perl hacker