my @array = map {$_ * 10} 1 .. 20; # test data while (@array > 8) { print join "\n", splice(@array,0,9); print "\n--------------------\n"; }