Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the Perl operators

Shulou Source: shulou.com Published: 2022-06-02 07:56:07 11月15日 Update

Editor to share with you what Perl operators are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!

Perl operator

Arithmetic operators of the Perl operator: + (add),-(minus), * (multiply), / (divide), * * (power),% (remainder),-(monocular negative)

(1) the cardinality of power cannot be negative, such as (- 5) * * 2.5#error

(2) the result of power cannot exceed the limit expressed by computer, such as 10**999999#error.

(3) if the Operand of the remainder is not an integer, it is rounded to an integer; the right side of the operator cannot be zero.

(4) monocular negativity can be used as a variable:-$y * is equivalent to $y y *

(5) should be + =,-=, * =, / =, * * =,% =

The integer comparison operator of the Perl operator

Table1. Integer comparison operator

The result of the operator is:

0-two values are equal

1. The value of music is large.

1-the second value is large

String comparison operator of Perl operator

Table2. String comparison operator

Logical operators of the Perl operator

Logic or: $a | | $b or $aor$b

Logic and: $a million or $aand$b

Logic is not:! $an or not$a

Logical XOR: $axor$b

Bit operator of Perl operator

Bit and: &

Bit or: |

Bit Fei: ~

Bit XOR: ^

Move to the left: $x2

Note: do not use & for negative integers because PERL will convert them to unsigned numbers.

The assignment operator of the Perl operator

Table3. Assignment operator

These are all the contents of the article "what are the Perl operators?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Operations operators integers logic powers articles content characters strings results rounded not so two variables right sign cardinality most operands operators Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Shulou Technology Redmi NVidia Apple