http://qs1969.pair.com?node_id=904676


in reply to How to read every 16 line of file ?

I think what you want is reading 16 lines in a gulp not every 16th line.

Cheers Rolf

UPDATE:

more explicit:

while ( @lines = readlines($filehandle,16) ) { print @lines,"----\n"; } sub readlines { my ($fh, $count) = @_; my @gulp; while (<$fh>) { push @gulp,$_; last unless --$count; } return @gulp; }