Programming has always been about manipulating data, so you can't do much with all these variables unless you have some operators to work on them. There are three main types of operators in Perl: comparison, compound, and arithmetic operators. Comparison operators compare the value of one operation or statement with that of another to see if the overall statement resolves to either "true" or "false." A different course of action can be followed within the program, depending on how statements resolve. Table 30.1 lists the comparison operators offered by Perl. You'll notice that the operators are different for numerals and strings.
Compound operators are largely identical to Boolean operators and can be combined with other operator types into more complex forms of results. These are listed in Table 30.2.
Arithmetic operators can be used to perform all sorts of mathematical operations on variables. These are listed in Table 30.3.
|