www.perl.com
Perl Programming
Boolean Operators
  • Separate operators for numeric vs. string comparison
    • Numeric (<=, >=)
    • String (le, ge)

        my ($a, $b) = ("apple", "orange");
        print "1: apples are oranges\n" if ($a eq $b);  # False
        print "2: apples are oranges\n" if ($a == $b);  # True!

        my ($x, $y) = (12, 100);
        print "3: $x is more than $y\n" if ($x gt $y);  # True!
        print "4: $x is more than $y\n" if ($x > $y);   # False
      

        2: apples are oranges
        3: 12 is more than 100
      
Previous http://stuff.mit.edu/iap/perl/