Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Xho Jingleheimerschmidt
August 14, 2010, 3:12 am
Re: Appropriate technique for altering a text file?
I use the first method, line by line, if the lines are logically
independent (the most common case), or usually if the dependence is
simple and entirely backwards. I use method 3, slurping (either into a
scalar or an array) otherwise. I only use method 2, keeping a look-back
or ring buffer, if the file were so large or had the potential to become
so large that slurping could threaten my memory.
No, it is the middle method that I consider a last resort.
- » FAQ 4.74 How do I print out or copy a recursive data structure?
- — Next thread in » PERL Discussions