Will clear the file when the open statement executes, so you get an "empty" file to write to.open HANDLE,">","/path/to/file" or die "Cannot overwrite file: $!"; print HANDLE "Whatever"; close HANDLE;
See perldoc perlopentut.
edit: typo in print statement fixed.
In reply to Re: empty a file
by Joost
in thread empty a file
by GS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |