D.3. Operators

The following tables detail the various operators present in the Perl language.

D.3.1. Perl Arithmetic Operators

OperatorUse
+Addition
-Subtraction
*Multiplication
/Division
%Modulus
**Exponent
++Increment
--Decrement

D.3.2. Perl Assignment Operators

OperatorUse
=Assignment
+=Increment assignment
-=Decrement assignment
*=Multiplication assignment
/=Division assignment
%=Modulus assignment
**=Exponential assignment
.=String concatenation assignment

D.3.3. Perl Comparison Operators

OperatorUse
==Numeric is equal to
!=Numeric is not equal to
>Numeric is greater than
<Numeric is less than
>=Numeric is greater than or equal to
<=Numeric is less than or equal to
eqString equality
neString nonequality
gtString greater than
ltString less than
geString greater than or equal to
leString less than or equal to

D.3.4. Perl Logical Operators

OperatorUse
&&And
||Or
!Not

D.3.5. Perl Bitwise Operators

OperatorUse
&And
|Or
^Xor
~Not
<<Left shift
>>Right shift

D.3.6. Perl Miscellaneous Operators

OperatorUse
.Object/property/method separator
?Condition operator
deleteDelete specified object
newCreate new object
thisReference current object
refType of object (number, string, and so on)
voidEvaluate expression without return value

D.3.7. String Operators

OperatorUse
.Concatenation
xRepetition

D.3.8. String Tokens

TokenCharacter
\bBackspace
\eEscape
\tHorizontal tab
\nLine feed
\vVertical tab
\fForm feed
\rCarriage return
\"Double quote
\'Single quote
\$Dollar sign
\@At sign
\\Backslash

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.