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); }
|
---|
In Section
Seekers of Perl Wisdom