http://qs321.pair.com?node_id=43875


in reply to Re: Reading multiple lines?
in thread Reading multiple lines?

Well that's the kind of thing which would be nice to write, except I'd probably do it like this :-

@lines[0..9] = <FILE>

...but it still reads the whole file in (it just throws most of it away). Firstly, that'll use too much memory in this case, and secondly you can't then read the next N lines in.

Have fun,

rdw