i have a cgi file to display the league bowlers in a data file. it works just fine as long as their number of games, and scores aren't 0 (which it is set to by default). why wouldn't this print out the bowler information if those values are set to 0?
Code:
#!/usr/local/bin/perl
print "Content-Type: Text/html\n\n";
open (bowlers, "bowl.dat") or die ("file didn't open");
@bowlerInfo = <bowlers>;
close (bowlers);
chomp(@bowlerInfo);
print "<html>\n";
print "<head>\n";
print "<title>Lake Side Bowling League: View all.</title>\n";
print "</head>\n";
print "<body>\n";
print "<h1>Lake Side Bowling League</h1>\n";
print "<h3>Individual Scores</h3>\n";
print "<table border='1'>\n";
print "<tr><td><b><center>Name</center></b></td><td><b><center>Average</center></b></td>
<td><b><center>High</center></b></td><td><b><center>Games</center></b></td></tr>\n";
foreach(@bowlerInfo)
{
($id, $lName, $fName, $total, $numGames, $hScore) = split(/#/, $_);
$average = $total / $numGames;
$average = sprintf("%.2f", $average);
print "<tr><td>$fName $lName</td><td>$average</td><td>$hScore</td><td>$numGames</td></tr>\n";
}
print "</table><br />\n";
print "<a href='[URL unfurl="true"]http://tacosalad.lssu.edu/~neitrem/csci333/bowling/index.html'>Back[/URL] to main</a>\n";
print "</body>\n";
print "</html>\n";