Perl Operators   «Prev  Next»
Lesson 3Perl Operator Precedence
ObjectiveOrder in which Perl expressions are evaluated.

Perl Operator Precedence

In expressions where more than one operator is in use, some parts of the expression will be evaluated before other parts.
The rules that dictate this are based on a concept called operator precedence. The operators which have higher precedence are evaluated before the operators with lower precedence.
For example, consider this expression:

$x = 5 * 3 + 4;

Will the value of$x be 19 (15 + 4) or
35 (5 * 7)?
Use this list of operators, in order of precedence, for reference throughout this module.
The rest of this module is not in the order of precedence. The order was chosen to put related operators together, and to give you the operators first that will help you understand the later ones.
In the next lesson you will learn about the basic math operators.