Logical Operators in Perl
What are the Logical Operators?
The following are the Logical Operators used in Perl.
|Operator ||Function |
|&& ||and ||logical conjunction of the two surrounding expressions |
||| ||or ||logical disjunction of the two surrounding expressions |
|! ||not ||returns the logical negation of the expression to its right |
print "content-type: text/htmlnn";
print "Condition is true";
print "Condition is False";
Condition is true
In the above example, the variables are compared with two conditions 1<5 and 5>1, so the result would give "Condition is True" as both the conditions are satisfied.