http://www.perlmonks.org?node_id=590700


in reply to Ensuring only one copy of a perl script is running at a time

As I understand it, the first argument to flock must be a filehandle. So the fact that the tricky use of __DATA__ works on unix seems better characterised as an unclosed loophole and your own solution as the correct version that accords with the manual.

-M

Free your mind