Glad I waited until you posted first! But here is my contribution, non-destructive of the array. Replace the while{} with the following:
OUTER: for (my $r = 0; $r < @primeNumbers; $r += $NumPerRow) { for (my $c = r; $c - $r < $NumPerRow; $c++) { printf $format, $primeNumbers[$c]; last OUTER if ($c == $#primeNumbers); } print "\n"; }
In reply to Re^4: sprintf not acting like I expect
by GotToBTru
in thread sprintf not acting like I expect
by NateTut
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |