Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Replacing a character in a fileby Laurent_R (Canon) |
on Jan 03, 2018 at 20:31 UTC ( [id://1206631]=note: print w/replies, xml ) | Need Help?? |
If you really want to get rid of some characters in your data (and I agree with 1nickt++ that perhaps you shouldn't), then it would probably be better to store the result of your query into an array in memory, modify the array to clean it up and then only write the data to a file, rather than writing immediately to a file and then trying to change the file.
Also, it seems that your code is opening the Plants.txt file in write mode, this will clutter the existing file, probably not what you want.
In Section
Seekers of Perl Wisdom
|
|