Hi,
Well that code is a step in the right direction. Couple things though, you can put the test inside the while loop instead of using "last". You can grab the first 9 items off of the array and delete them from the array in one operation using splice. This lets you avoid using the "@i" array. So:
my @array = map {$_ * 10} 1 .. 20; # test data
while (@array > 8) {
print join "\n", splice(@array,0,9);
print "\n--------------------\n";
}
Note that if the array isn't divisible by 9, the last few items will be silently ignored. If you'd rather see them, it's safe to just omit the "> 8".. splice will return whatever remains even though it's not the full 9 items.