in reply to empty a file
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: empty a file
by GS (Acolyte) on Jun 27, 2004 at 16:16 UTC | |
by valdez (Monsignor) on Jun 27, 2004 at 16:21 UTC | |
by Anonymous Monk on Jun 27, 2004 at 23:03 UTC | |
by Joost (Canon) on Jun 27, 2004 at 16:19 UTC | |
|