Next | Program Repair Shop | 158 |
print_cell exists to print a cell in a table
That is what this line is also doing:
236 print ("<td>" . $squares->[2][$x] . "</td>\n");
If that can be inline, why not print_cell's prints also?
for my $row (0..2) { print "<tr>"; foreach my $col (0..2) { if ($squares->[$row][$col] eq "") { print ("<td><input type='checkbox' name='choice' value='[$row][$col]'></td>\n"); }else { print ("<td>" . $squares->[$row][$col] . "</td>\n"); } } print "</tr>\n"; }
Now we eliminate print_cell entirely
9 lines become zero!
Next | Copyright © 2002 M. J. Dominus |