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'; }
In reply to Re^4: Passing input through a hash then displaying results
by ikegami
in thread Passing input through a hash then displaying results
by brayshakes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |