Yes, there is.
while (my @a = grep defined, map scalar <$fd>, 1 .. 6) { # do whatever you want with @a, which has 6 lines }
I asked a similar question, two years ago.
In reply to Re: Reading chunks of text
by cog
in thread Reading chunks of text
by Hue-Bond
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |