This article mainly introduces the differences between the detailed Perl string comparison and the integer comparison, the needs of friends can refer to the following
This article introduces you to Perl string comparisons and integer comparisons.
Perl strings in the Perl language can be divided into single and double quoted strings, so how do you compare Perl strings?
Please see this article for more information:
This article focuses on Perl string comparisons and integer comparisons,
The comparison of arithmetic operators is greater than, less than, equal to, not equal to,
And Perl string comparisons are no exception,
Here is a detailed introduction to you:
One. String comparison operators
Operator description
LT is less than
GT Greater than
EQ equals
Le is less than or equal
GE is greater than or equal
NE is not equal to
CMP comparison, return 1,0,or-1
Two. Integer comparison operators
Operator description
< less than
> Greater than
= = equals
<= less than or equal to
>= greater than or equal to
! = does not equal
<=> comparison, return 1, 0, or-1
Ps:
The integer comparison operator is a numeric comparison,
The left and right operands are converted to numbers when used.