in reply to Tie::File problem

The Tie::File object keeps track of where every line starts as it reads the file (in an array reference), so as you 'push' new lines on the end of the file, that array will grow bigger. It has to read every line to get to the end of the file so that it knows at what 'index' the current last line is, so there is an entry in that array for every line in your file. Then this array is a direct index into the lines of your file via seek.

I don't know how easy it would be to add an option to make Tie::File 'forget' where some of the lines start, but that is what it would take. Maybe there could be an option to 'forget' where the first N lines started, or just keep track of every Nth line, either way, it would take some programming. (Update: Or better yet, an option to not even remember where any line starts until it "needs to know", so you could push to your heart's content and not eat up memory).

Maybe Tie::File is not the answer for you at this point if all you want to do is add a few lines to the end of a large file.