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


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

If I misunderstood and you are trying to get blocks of 16 lines,

my @buf; while (<>) { push @buf, $_; if (@buf == 16) { do_it(\@buf); @buf = (); } } if (@buf) { do_it(\@buf); }