my @list = 1..30; while (@list) { print join "\t", splice(@list, 0, 4); print "\n"; }