in reply to Re^3: Passing input through a hash then displaying results
in thread Passing input through a hash then displaying results
Sorry, I meant to say "That's why the looping is needed if you use a hash."
Of course, you could just do
sub get_score { my ($score) = @_; return 'A' if $score >= 90; return 'B' if $score >= 80; return 'C' if $score >= 70; return 'D' if $score >= 60; return 'F'; }
|
|---|