This is a perfect job for Tie::File
How so? It needlessly reads the entire file (except for the ~5 lines of headers and footers) twice!
If that's no problem because the file is small, why didn't you just read the whole thing into memory instead of adding the monstrous overheard of Tie::File to the equation?
If that's a problem because the file is large, use a rolling buffer. I think you'll find that saying it'll make it 10 times faster is an understatement.
In reply to Re^2: More efficient way to exclude footers
by ikegami
in thread More efficient way to exclude footers
by babysFirstPerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |