Discussion Forums HTML, XML, JavaScript... |
 |
Software Reviews Editors,Others... |
 |
Top100 JavaScript Tutorials, ... |
 |
Tutorials ASP, CSS, Databases... |
Discussion List FAQ, Roundup, Configure ... |
 |
Authoring HTML, JavaScript, CSS... |
 |
Design Layout, Navigation,... |
 |
Graphics Tools, Colors, Images...
|
 |
Software Browsers, Editors, XML...
|
 |
Internet Domains, E-Commerce, ... |
 |
WDVL Resources Intermdiate, Tutorials,... |
 |
WDVL Discussion Lists, Top 100,... |
 |
| Technology Jobs |
 |
|
Table 1. Basic Perl Operators
April 26, 1999
The table below summarize the common Perl operators used
in arithmetic and string operations.
Table 1. Basic Perl Operators
|
Operator
|
Name
|
Description
|
Example
|
Result
|
|
+
|
addition |
Sums values together. |
20+30 |
50 |
|
-
|
subtraction |
Subtracts right value from left value. |
20-10 |
10 |
|
*
|
multiplication |
Multiplies values together. |
20*30 |
600 |
|
/
|
division |
Divides left value by right value. |
20/5 |
4 |
|
%
|
modulus |
Remainder of dividing left value by right value. |
20/3 |
2
20 divided by 3 yields 6 (6*3=18) with a remainder of 2
(20-18). |
|
**
|
exponential |
Raises the left value to the power of the
right value. |
20**2 |
400
Equivalent to 20*20 |
|
.
|
string concatenation |
Chains together the characters in each value. |
"hot"."dog"
"hot "."dog" |
"hotdog"
"hot dog" |
|
x
|
string replicate |
Repeats the characters in left value the right
value number of times. |
"*"x5
"*"x5."Hello"."*"x5 |
*****
*****Hello***** |
Perl Variables: Scalars
The Perl You Need to Know
Perl Variables: Comparing Scalars
|
|