In the Perl language, Perl strings can be divided into single quotes and double quotes, so how to compare
Perl strings
?
Comparison has relationships such as greater than, less than, equal to, and not equal to,
and Perl string comparison is no exception.
Here is a detailed introduction to you:
1. String comparison operators
Operator description
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 comparison, return 1,0,or-1
2. 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, returns 1, 0, or -1
PS:
The integer comparison operator is a numerical comparison, and
when used, both the left and right operands will be converted into numbers.