in reply to Re: Clearing out the filein thread Clearing out the file
open FILE,">>filename"; truncate FILE, 0; close FILE [download]
truncate works also on filenames:
$ echo abcde > file $ perl -e 'truncate "file", 2' $ cat file ab [download]
-- David Serrano