Next | Program Repair Shop | 151 |
Replacing ? with undef in $squares messes up the output
Here's why:
214 foreach $x(0..2) { 215 if ($squares->[0][$x] eq "?") { 216 print_cell($squares, $page, $x, "0"); 217 }else { 218 print ("<td>" . $squares->[0][$x] . "</td>\n"); 219 } 220 }
(print_cell generates the checkbox control)
We can fix that with a test for ""
foreach $x(0..2) { if ($squares->[0][$x] eq "") { print_cell($squares, $page, $x, "0"); }else { print ("<td>" . $squares->[0][$x] . "</td>\n"); } }
Let undef be your "special" value
Note this says "let", not "make"
If it doesn't want to be, don't force it
Next | Copyright © 2002 M. J. Dominus |