Prev | Current Page 1159 | Next

Michael McCallister

"openSUSE Linux Unleashed"

2.
TABLE 30.2 Perl Compound Operators
Meaning Operator
Logical AND &&
Logical OR ;;
Logical NOT !
Group these compound statements ()
Arithmetic operators can be used to perform all sorts of mathematical operations on variables.
These are listed in Table 30.3.
Perl Programming 615
30
TABLE 30.3 Perl Arithmetic Operators
Meaning Operator
Raises x to the y power x**y
Calculates the remainder of x/y x%y
Adds x to y x+y
Subtracts y from x x-y
Multiplies x times y x*y
Divides x by y x/y
Negates y -y
Increments y by 1 and uses value ++y
Uses value of y and then increments by 1 y++
Decrements y by 1 and uses value ??”y
Uses value of y and then decrements by 1 y++
Assigns value of y to x x=y
Regular Expressions
Many Linux applications use regular expressions to simplify searches. In Perl, regular
expressions have been taken to the level of an art form.
Statements with regular expressions use several of the same symbols that wildcards and
operators use, but for slightly different reasons. Regular expressions use symbols to match
patterns in text.


Pages:
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171
Internet felgi aluminiowe poznań życzenia urodzinowe Jaki wybrać olej Connie Talbot