Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Ensuring only one copy of a perl script is running at a time

by benizi (Hermit)
on Dec 20, 2006 at 00:21 UTC ( [id://590826] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    create table foolock (
     /* since we're exclusive per-program, make program primary */
    ...
     client varchar(255) not null,
     time timestamp
    );
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    use warnings;
    ...
    } else {
        # take appropriate action
    }