所以现在这就是我所拥有的:
if ($stuff =~ /^(bad|alsobad)$/) {
print "Seems incorrect";
exit 0;
}
在某种程度上可能有类似的东西吗?
if ($stuff =~ /^(bad|alsobad)$/){
#
if ($twostuff =~ /^(nan|na)$/) {
print "Seems incorrect";
exit 0;
}
#
}
答案 0 :(得分:3)
您的代码:
if ($stuff =~ /^(bad|alsobad)$/){
if ($twostuff =~ /^(nan|na)$/) {
print "Seems incorrect";
exit 0;
}
}
......应该工作得很好。另一种选择是:
if ( $stuff =~ /^(bad|alsobad)$/ and $twostuff =~ /^(nan|na)$/ ){
print "Seems incorrect";
exit 0;
}