I open a file to append some data but the next time when the script runs I want this file to be deleted so that the data doesnt get appended to the already existing file.I know there is an unlink command but I read somewhere that renaming would be a best option?I want to get the fellow monks opinion on this.Please let me know your suggestions
open(my $OUTPUT, '+>>', "my file.txt") or die $!; if (@array) { print $OUTPUT "@array"; } if (@array2) { pprint $OUTPUT "@array2"; }
In reply to Unlink or rename? by iphone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |