in reply to reading several lines in a gulp
my $count=3; while (<DATA>) { next if ($.-1) % $count and ! eof; print @gulp; print "-----\n"; @gulp=(); } continue { push @gulp,$_ } __DATA__ a b c d e f g h
I'm sure there are more elegant solutions...
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: reading several lines in a gulp (iterator)
by LanX (Saint) on May 01, 2011 at 13:06 UTC | |
by John M. Dlugosz (Monsignor) on May 01, 2011 at 13:25 UTC |