truncate 'file.dat', 0 or die "Can't truncate file.dat: $!";