print ul( map { ul("$course") } keys %data);
looks wrong. What you're doing here is printing the same $course (which contains the last course read) for every record. Also you're going to get Extremely Funky HTML (lists inside lists, without any items?) What you want is probably something like:
print "<ul>";
foreach my $ref ( @records ) {
print "<li>", $ref->{Course}, "</li>";
}
print "</ul>";
Do you see the difference? While $course refers to the variable that never changes in your final loop, whereas $ref->{course} refers to the data in the hash reference whose key is the string "course". This does change because $ref changes for every iteration.
Update: changes "course" to "Course" in key.