in reply to Re: Clearing out the file
in thread Clearing out the file

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