Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the Perl operators

Shulou Source: shulou.com Published: 2022-06-02 07:56:42 10月03日 Update

This article mainly shows you "what are the Perl operators", which is easy to understand and clear, hoping to help you solve your doubts. Let the editor lead you to study and learn this article "what are the Perl operators?"

Perl operator

Arithmetic Perl operators: + (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 *

II. Integer comparison Perl operator

Table3.1. Integer comparison Perl operator

The Perl operator results in:

0-two values are equal

1. The value of music is large.

1-the second value is large

String comparison Perl operator

Table3.2. String comparison Perl operator

Logical 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

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.

VI. Assignment operator

Table3.3. Assign Perl 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: Operators integers logic powers content articles characters strings results learning help operations rounding two variables right sign cardinality operands easy to understand Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS vpn Microsoft Linux Apple