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
In reply to Re: reading several lines in a gulp
by LanX
in thread reading several lines in a gulp
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |