in reply to How do I backtrack while reading a file line-by-line?
That being said, to add onto ikegami's idea, you can use tell to tell you where the line is, push that on an array. Then when you want to go back X number of times, then you can always seek to the line ($lines[-1] .. $lines[-4]).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I backtrack while reading a file line-by-line?
by Fletch (Bishop) on Oct 13, 2006 at 20:46 UTC | |
|
Re^2: How do I backtrack while reading a file line-by-line?
by mdunnbass (Monk) on Oct 18, 2006 at 20:14 UTC |