one thing, you're not lazy enough.
# untested
use strict;
my %questions = (
1 => { question => "Who's Perl's top dog?",
answer => "Larry Wall" },
2 => { question => "What's the answer?",
answer => "42" },
);
foreach my $question (sort {$a <=> $b} keys %questions) {
my $guess = param("$Q$question");
print "$question). You answered: $questions{$question}{question} wit
+h $guess. ";
if ($guess eq $questions{$question}{answer}) {
print q|<font color="green">Correct</font><br>|;
} else {
print q|<font color="red">Incorrect</font><br>|;
}
}
# keeping totals left as homework =)