Next File Locking 6

Trick #2: Only one process running at a time

        open SELF, "< $0" or die ...;
        flock SELF, LOCK_EX | LOCK_NB  or exit;

Trick #2a

        flock DATA, LOCK_EX | LOCK_NB  or exit;
        ...
        __DATA__        


Next Copyright © 2003 M. J. Dominus