in reply to Speed differences in updating a data file
So I'd expect that once your file passes a certain mystery size threshold, your first approach will be much faster.
If you don't need the other lines, why keep them around? Of course, for a small file, it's hard to beat the ease of typing
If your problem requires multiple passes over the data, or transformations across all the lines, then you may not have a choice but to keep it all in memory, though. An example of that would be a matrix transposition, for instance.my @lines=<FILE>;
|
|---|