# do this once: my @grades = ( ('F' ) x 40, # 0..39 ('E' ) x 10, # 40..49 ('D' ) x 10, # 50..59 ('C' ) x 5, # 60..64 ('C+') x 5, # 65..69 ... ); # do this many times: my $grade = $grades[$ARGV[0]]; print "The student has gotten a $grade grade for the score of $ARGV[0].";