Tutorials
In Perl, the comparison operators are divided into two classes:
  • Comparison operators that work with numbers
  • Comparison operators that work with strings Integer-Comparison Operators
    Operator Description  
    <        Less than 
    >        Greater than 
    ==       Equal to 
    <=       Less than or equal to  
    >=       Greater than or equal to  
    !=       Not equal to 
    <=> Comparison returning 1, 0, or -1  
    
    Each of these operators yields one of two values:
  • True, or nonzero
  • False, or zero

    The <=> operator is a special case. Unlike the other integer comparison operators, <=> returns one of three values:
  • 0, if the two values being compared are equal
  • 1, if the first value is greater
  • -1, if the second value is greater

    String-Comparison Operators
    For every numeric-comparison operator, Perl defines an equivalent string-comparison operator.
    String operator Comparison operation 
    lt              Less than 
    gt              Greater than 
    eq              Equal to 
    le              Less than or equal to  
    ge              Greater than or equal to 
    ne              Not equal to !=  
    cmp             Compare, returning 1, 0, or -1
    
    
  • Perl
    My First Perl Program
    Perl Scalars
    Perl Lists
    Perl Operators
    Perl Arrays
    Perl Hashes
    Perl If..elsif..else
    @ARGV and %ENV
    Perl Loop statements
    Perl Subroutines
    Perl References
    Perl Regular Expressions
    Perl File Operations
    Perl Objects, Classes
    Perl DBI (Databases)
    Perl Signals
    Perl command line..
    Perl Special Variables
    Perl Reference
    Perl SOAP
    Perl Threads