Like the following, and you need to use && not "and" (unless you get the precedence straight by using ()):
if(($response eq "arrow" && $theword eq "sparrow")) { ... } elsif(($response eq "axe" && $theword eq "wax")) { ... } elsif(($response eq "shield" && $theword eq "field")) { ... } elsif(($response eq "spear" && $theword eq "tear")) { ... } else { }
In reply to Re^3: logic problem with perl game
by PeterPeiGuo
in thread logic problem with perl game
by mynameisG
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |