Using boolean operator (and &&) to connect the comparison operator : Boolean Operators « Language Basics « Perl






Using boolean operator (and &&) to connect the comparison operator

   


#!/usr/bin/perl -w

print "Test one: ", 6 > 3 && 3 > 4, "\n";
print "Test two: ", 6 > 3 and 3 > 4, "\n";

   
    
    
  








Related examples in the same category

1.Logical Operators (Short-Circuit Operators)
2.! $v1 && $v2
3.&&, ||, and !
4.@a1 = $v1 && 1 .. 10;
5.Boolean Combination Operators
6.Compound Boolean operator Or: ||=
7.Logical operators are defined
8.Precedence with word operators and short-circuit operators
9.Short-circuit operators
10.The 'and' Operator