Unless your lines are all the same length, I think the best way is probably that which you've chosen. If, however, your lines
are all the same length, you could use
seek();.
Here is how I read in a specific line from a file if I am only interested in the one bit of a file.
$. = 0;
do { $LINE = <FILE> } until $. == $DESIRED_LINE_NUMBER || eof;
Now, if you're going to potentially bounce around within the file (say, look at line 5000, then line 20, then line 42, etc), there are other strategies, but since I don't think that's what you're looking for, we won't go there right yet. . .
- - arden.
arden is more of an orangutan than a monkee