open FILE,">>filename"; truncate FILE, 0; close FILE
truncate works also on filenames:
$ echo abcde > file $ perl -e 'truncate "file", 2' $ cat file ab
--
David Serrano
In reply to Re^2: Clearing out the file
by Hue-Bond
in thread Clearing out the file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |