|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: Re: Re: Best way to read line x from a fileby arden (Curate) |
| on Mar 29, 2004 at 10:55 UTC ( [id://340647]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
No, seek() is not wasteful, however it doesn't really understand the concept of a line either. Seek basically blitzes its way to the location requested, so any future reads start from that location. You can also use seek to go backwards in a file too. But again, it doesn't work on the principle of "lines", instead it works on "byte offsets". That's why in your case it would only work if every line is of the same length.
- - arden.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||