in reply to Deleting on Files

Simply open the file for writing -- that will automatically truncate it.

open FILE, '>', 'sample.txt' or die "Could not open sample.txt: $!"; close FILE;

Update: I second the recommendation for logrotate.