You've stumbled upon a race condition/race condition
The solution is locking/flocking, ala File::CounterFile
In reply to Re: Writing to the same file from different instances
by Anonymous Monk
in thread Writing to the same file from different instances
by vit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |