Compare the differences between Perl strings and integers

Source: Internet
Author: User
Tags arithmetic operators
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.