is there a simpler way to do this? I want something that will be generous enough to not lock up the entire program if it can't lock one file, but I also want it to be able to retry if someone else has it locked at the moment.FLOCK: do { open (FILE, ">file.dat"); flock(FILE, 2) or redo FLOCK; print FILE "blah\n"; close FILE; $locked = 1; } while ($locked =/ 1)
In reply to flock till ya get it right by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |