September 2002
Intermediate to advanced
496 pages
10h
English
This section presents the Perl operators that derive from the C language. Many of these allow for the writing of succinct code.
Most operators are binary in nature; that is, they have two operands. For example, the addition operator is binary. In the line of code below, $y and $z are the two operands.
$x = $y + $z;
Any binary operator can be written using the assignment operator rather than using the longer and more traditional approach. Here are some traditional assignment statements using some simple arithmetic operators.
$x = $x + 5; # addition $x = $x / 2; # division $x = $x * 2; # multiplication $x = $x ** 5; # exponentiation
Perl has a set of operators that are collectively referred ...
Read now
Unlock full access