Perl Learning Three: Operators

Source: Internet
Author: User
Tags bitwise operators


Operator:

1.operand
operator
Expression
Statement
2. Arithmetic operators
+
-
*
/
**
%
-
The string join operation must be converted to an integer if it cannot be converted to 0.

2. Arithmetic comparisons
<
>
==
<=
>=
!=
<=>
Note:<> is not an operator, console input
3. String comparisons
Lt
Gt
eq
Le
Ge
Ne
Cmp
Compare by ASCII code
Note that some variables cannot be distinguished by a string or integer such as: ' 123 ' VS 123

4. String connection, repetition
.
X
eg
' A ' x 5 = ' AAAAA '
Note that the notation is otherwise connected when repeating.
5. Logical operators
&& (and)
|| (OR)
! (not)
Xor
6. Bitwise operators
&
|
~
^
<<
>>
7. Assignment operators
=
+=
-=
*=
/=
%=
**=
|=
^=
.=
8. Self-increment, self-reduction (more small knowledge points)
Arithmetic operations that can be used for string manipulation (+ +) to compare strings
9. Comma
10. Conditional operators
11. Priority Precedence
++/--, Monocular above the multi-mesh operator
Numeric operations > Comparison operations > Bitwise operations > Assignment operators > Logical operators
Digital operations: **>*/> +-
Comparison operation: <>>==! =
Note: or VS | | and VS && different priority levels

Binding nature:
General left combination (first left rear right)
Right combination: =?: Commonly used in these two. + =, *= are assignment operators
$a = 2;
$b = 1;
$a *= $b +=5 value is 12

Perl Learning Three: Operators

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.