print <<here;
<div align="center">
<h2>Grades</h2>
<table border ="2" bordercolor="green">
<tr>
<td>Name</td><td>Id#</td><td>Test 1</td><td>Test 2</td><td>Test 3</td><td>Average</td>
</tr>
here
my @record = $sql->fetchrow_array; ### there is only one row in resultset
for(my $i = 0; $i < @record; $i++ ) {
print "<td>$record[$i]</td>";
}
"<td>$avg \%.2f</td>";
print "</tr>";
print "</table></div></body></html>";
我无法将$avg
打印到只有两位小数。