sub main{
my $mark;
my $grade;
my $calc;
@grade = ($mark>=0 and $mark<=39,$mark>=40 and $mark<=49,$mark>=50 and $mark<=59);
@calc(F+,D+,B+);
print "What is the student’s mark?"
chomp($mark = <STDIN>);
print "Your mark is 'mark' and grade is 'calc'"
}
main();
嗨,我是初学者,我想做的是制作不同的标记块,例如 @mark(0-39,40-49,50-59) 将分别指向 @calc(F+,D+,B+)。之后我可以打印出 $mark 以及与标记对应的等级。谢谢您的帮助。