in reply to How to erase the file content
{ open my $fh, "> $file" or die "cannot open $file: $!" } [download]