in reply to How do I write to a file?
truncates and opens a file for writing. All the contents are lost.open FH , ">$output_file";
Opens a file for appending. When you start writing to this file, it will write to the end. To actually WRITE to that file you use the print commandopen FH, ">>$output_file";
print FH "I will print this to a file\n";
|
|---|