Next | Program Repair Shop | 284 |
for my $x (0..2) { for my $y (0..2) { $squares->[$x][$y] = $page->param("[$x][$y]"); } }
Instead:
for my $n (0..8) { my ($x, $y) = (int($n/3), $n%3); $squares->[$x][$y] = $page->param("[$x][$y]"); }
No.
How about:
for my $n (0..8) { $squares->[$n/3][$n%3] = $page->param("[".int($n/3)."][".$n%3."]"); }
Even worse.
But you can't really tell until you see it.
Next | Copyright © 2002 M. J. Dominus |