in reply to split on every n lines

undef $/; my @args = split /\n/, <DATA>; for(my $idx=4;$idx<@args+4;$idx+=5){ print join(" ", @args[$idx-4..$idx]), "\n"; } __DATA__ host1 host2 host3 host4 host5 host6 host7 host8 host9 host10 host11 host12
There's probably a better way, but i can't think well at this late hour.