On Sun, 2008-04-20 at 20:22 -0400, Chas. Owens wrote: > No, you obviously don't know how it is implemented. It seeks to the > end of the file and reads it into a buffer where it searches for line > endings. It does not read the entire file until you reach the first > line. >
That's not the point. Seeking the end of file means slowing down; because files are not linear in the disk space. To find the end of file means going through all the segments allocated to the file. And even in the best of OSes, it means reading a chain of sectors/clusters to find the end of file. And then work their way backward from that. That involves time. But since every line has variable line lengths, you cannot predict how much to back up. In other words, it's a waste of time. The fastest way to do this is to read every line into Perl and disregard everything not relevant. This is what Perl was design for. There are no magic tricks. You cannot fart before you ate beans. -- Just my 0.00000002 million dollars worth, Shawn When I was in college, my Karate instructor said, "The first hundred are easy." Since then, I discovered he'd lied. Life's too big to describe in hundreds. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/