Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
But wait, it gets better again!
You know how you can have that nifty __DATA__ block at the end of your script? It turns out you can lock that too :) I've used this a number of times and it works just great. #!/usr/bin/perl use strict; use Fcntl 'LOCK_EX', 'LOCK_NB'; unless ( flock DATA, LOCK_EX | LOCK_NB ) { print STDERR "Found duplicate script run. Stopping\n"; exit(0); } ... 1; ### DO NOT REMOVE THE FOLLOWING LINES ### __DATA__ This exists to allow the locking code at the beginning of the file to work. DO NOT REMOVE THESE LINES! In reply to Re^3: Cron Jobs That Run For Too Long
by adamk
|
|