Hi. I want empty the file contents before writing into it again.The following is my code:
open(FILE1 , ">" ,"testing1.txt"); print FILE1 "stat"; #Do the required actions print FILE1 "stat-updated"; close(FILE1);
The output file contents will be:
stat stat-updated
But I want the output file to contain just :stat-updated.How to do it?? Do I need to close the filehandle or call truncate or something else??
In reply to Empty File Contnts before writing by gautamparimoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |