There's probably a better way, but i can't think well at this late hour.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
In reply to Re: split on every n lines
by monsoon
in thread split on every n lines
by sunil9009
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |