Node:Summary of Scalar Operators, Previous:Special Variables, Up:Working with Scalars



Summary of Scalar Operators

In this chapter, we have looked at a number of different scalar operators available in the Perl language. Earlier, we gave a small chart of the operators, ordered by their precedence. Now that we have seen all these operators, we should consider a list of them again, ordered by precedence. Note that some operators are listed as "nonassoc". This means that the given operator is not associative. In other words, it simply does not make sense to consider associative evaluation of the given operator.

Operator Associativity Description
++, -- nonassoc auto-increment and auto-decrement
** right exponentiation
*, /, % left multiplication, division, modulus
+, -, . left addition, subtraction, concatenation
<, >, <=, >=, lt, gt, le, ge nonassoc comparison operators
==, !=, <=>, eq, ne, cmp nonassoc comparison operators

This list is actually still quite incomplete, as we will learn more operators later on. However, you can always find a full list of all operators in Perl in the perlop documentation page, which you can get to on most systems with Perl installed by typing perldoc perlop.