
BillKSmith
Veteran
Feb 14, 2018, 7:44 AM
Post #2 of 2
(1703 views)
|
The short answer to your question is that your elsif is true only if all three of the 'greater than' expressions are true. The '&&' is a 'logical and' operator. It returns a true value if both of its arguments are true (otherwise it returns a false value) In Perl, there are three values which are 'false' (undef, null string, and number 0). All other values are 'true'. In order to understand your statement, it necessary to also know that the '&&' operator has a lower precedence than the '>' operator. This means that the '>'s are evaluated before the '&&'s. The arguments for the first && are the results to the first two comparisons. The arguments of the second '&&' are the result of the first '&&' and the result of the third '>'. You can use the perl documentation reader 'perldoc' to get the official explanation. Learn to use the tool: Read about the operators: Good Luck, Bill
|