I think that your solution may work, but there is simpler solution; as usual the solution is in your manuals.
Take a look at man perlopentut, in section file locking
If you are not doing this for study, there is already a solution on CPAN, one of these is IO::LockedFile
In reply to Re: A flock()alypse now
by valdez
in thread A flock()alypse now
by ferrency
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |