Just truncate the file to zero and close.
For finer-grained control, look at a combination of sysopen with the O_EXCL flag and flock. See perldoc perlopentut (which doesn't seem to be in the Library).
In reply to Re: Avoiding a race condition
by takshaka
in thread Avoiding a race condition
by Ian the Terrible
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |