|
|
| XP is just a number | |
| PerlMonks |
Re: Unlink or rename?by samarzone (Pilgrim) |
| on Dec 22, 2010 at 06:39 UTC ( #878445=note: print w/ replies, xml ) | Need Help?? |
|
If you don't care for the old data why are you opening the file in append mode? Use '>' for opening file. You have also incorrectly written my where only file name should be. There is no value of a keyword inside double quotes if you are not evaling it. It should be something like open(my $OUTPUT, '>', "file.txt") or die $!;Don't forget to close the handle close($OUTPUT)Update: As pointed by hossman and Anonymous Monk below, "my file.txt" has no problem as a file name. My assumption was that you were expecting a file named "file.txt"
--
Regards
- Samar
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||