Detailed explanation of the difference between Perl strings and integers

巴扎黑
Release: 2017-09-05 11:31:25
Original
2435 people have browsed it

This article mainly introduces the detailed explanation of the difference between Perl string comparison and integer comparison. Friends who need it can refer to it

This article introduces Perl string comparison and integer comparison.
Perl language Perl strings can be divided into single-quote and double-quote strings, so how to compare Perl strings?
Please see this article for detailed introduction:
This article will focus on Perl string comparison and integer comparison.
Arithmetic operator comparisons include greater than, less than, equal to, not equal to, etc.,
and Perl string comparison is no exception,
Here is a detailed introduction to you:

1. String comparison operator

Operator description
lt is less than
gt is greater than
eq is equal to
le is less than or equal to
ge is greater than or equal to
ne is not equal to
cmp comparison, returns 1,0,or-1 

2. Integer comparison operator

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. When
is used, both the left and right operands will be converted into numbers.

The above is the detailed content of Detailed explanation of the difference between Perl strings and integers. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!