http://qs1969.pair.com?node_id=596049


in reply to Re^4: Passing input through a hash then displaying results
in thread Passing input through a hash then displaying results

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; }

-=( Graq )=-