How do I represent the values and keys in a loop or conditional statement?
You gets the keys and values of a hash using keys and values.
There is various documentation throughout the internet: keys and values.
I'm not sure if map counts as a loop, but if it does, then this has hash values in a loop and a conditional (or two):
sub get_grade
{
my $score = shift;
my $grade = 'Ungraded';
$score = 0 unless $score =~ /^\d+$/;
map { $grade = $grade_scores{$_} if $score > $_ } sort keys %grade_s
+cores;
$grade;
}