tanger has asked for the wisdom of the Perl Monks concerning the following question:
01: While(-f counter.lock){ 02: select(undef,undef,undef,0.1);} 03: open(LOCKFILE,">counter.lock); 04: dbmopen(%COUNTERS, $DOCUMENT_ROOT/DBM_FILES/counters,0666); 05: if(!(defined($counters{'my_counter'})){ 06: $counters{'my_counter'}=0;} 07: $counters{'my_counter'})++; 08: $count=$counters{'my_counter'}; 09: dbmclose (counters); 10: close(LOCKFILE); 11: unlink(counter.lock);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Locking database
by chromatic (Archbishop) on Feb 18, 2001 at 08:38 UTC | |
by tilly (Archbishop) on Feb 18, 2001 at 08:56 UTC | |
|
Re: Locking database
by arturo (Vicar) on Feb 14, 2001 at 01:09 UTC | |
|
(redmist) Re: Locking database
by redmist (Deacon) on Feb 14, 2001 at 01:52 UTC |