my $testQuery = "SELECT questionNum, question, answer1 FROM results WHERE title = ? ORDER BY questionNum"; my $sty = $dbh->prepare($testQuery); $sty->execute($marathon); my $potential = $sty->fetchall_arrayref(); $sty->finish; my $previous_question; my $previous_answer; my $countEm; my @total; my @totalAnswer; my @norm; my $last_arr_index; foreach my $data (@$potential) { my ($questionNumber, $question, $answer1) = @$data; $answeredOne = 0; print qq{
##
my $counting;
my @totalCounting;
my @link = ('water', 'water', 'water', 'water', 'water');
foreach my $i (@link){
$counting++;
push @total``Counting, $counting;
}
say @totalCounting[-1];