in reply to Re^3: sprintf not acting like I expect
in thread sprintf not acting like I expect
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"; }
|
|---|