Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
As others have said, this is wasteful because it reads the whole file while it should read only the first 9 lines. If you want a solution that has no visible loop (or map etc), you could try using the module Tie::File. This module is in the standard Perl distrib. (Note that Tie::File numbers the lines with zero-offset.) Otherwise, for me seems the best solution but there might be a more elegant one. In reply to Re: Best way to read line x from a file
by ambrus
|
|