I am guessing one of the reasons that you used seek and tell, is prpobably memory concern.
Still I suggest you to use Tie::File as Fletch already suggested. I read its entire source code before, and the author of that module actually used memory in a really wise way.
To use it, just do something like:use Tie::File; my $self = tie @array, "Tie::File", "test.pl";
The first thing pop up in your mind might be whether the whole file would be loaded into that array (and I can see that you are only interested in a small piece of the file at any given moment). The answer is NO. The array size is not only well controlled, but also configurable.
In reply to Re: Problem with SEEK to go back/forward a few lines.
by pg
in thread Problem with SEEK to go back/forward a few lines.
by GaijinPunch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |