Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Use of "elsif" or hash tables don't seem to go to the point.
Actually either of those approaches does solve the problem, which is (if I'm understanding the OP correctly) that: The OP thinks that the 'else' clause will be executed if NONE of the 'if' statements match, whereas actually the 'else' clause will be executed whenever the FINAL 'if' statement fails to match. i.e. OP's intention was but OP has got the syntax wrong and actually coded where even if one of a, b or c is true then default() is still executed (and overwrites the variable) so long as d is false. IIU the OP correctly. In reply to Re^2: If statement not working
by andye
|
|