Chapter 6. Where’s the Operator?

Where’s the Operator?

About Perl Operators

In the real world, there are operators who operate switchboards, computers, bulldozers, tanks, etc. In Perl, operators operate on numbers and strings or a combination of them. Operators are symbols, such as +, -, =, >, <, that produce a result based on some rules. An operator manipulates data objects called operands; e.g., 5 and 4 are operands in the expression 5 + 4. Operators and operands are found in expressions. An expression combines a group of values to make a new value, n = 5 + 4. And when you terminate an expression with a semicolon, you have a complete statement; e.g., n = 5 + 4.

Figure 6.1. Evaluating ...

Get Perl by Example, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.