我在Perl中使用if语句和/或运算符。无论我输入什么,它都会转向其他声明。我做错了什么?
my $ans = <STDIN>;
print "answer: $ans\n";
if ($ans eq "a" || $ans eq "b") {
print "you entered a or b";
}
elsif ($ans eq "c" || $ans eq "d") {
print "you entered c or d";
}
else {
print "not a b c d ";
}