www.perl.com
Perl Programming
Boolean Operators
  • Boolean operators provide boolean context
  • Many types of operators are provided
    • Relational (<, >, lt, gt)
    • Equality (==, !=, eq, ne)
    • Logical (high precedence) (&&, ||, !)
    • Logical (low precedence) (and, or, not)
    • Conditional (?:)

        my ($x, $y) = (12, 100);
        my $smaller = $x < $y ? $x : $y;
        print "The smaller number is $smaller.\n";
      

        The smaller number is 12.
      
Previous http://stuff.mit.edu/iap/perl/