Everyone knows how to use the assignment operator (=). There are other operators, when
used with "=" gives a different result.
Example:
#! C:\programfiles\perl\bin\perl
print "content-type: text/html\n\n";
$a = 50;
$a += 50;
print "Value of a using addition operator: $a \n";
print "<br>";
$a %= 8;
print "Value of a using modulus,assign operator: $a \n";
Result:
Value of a using addition operator: 100
Value of a using mod,assign operator: 4
The above statement is equivalent to "$a=$a+50", thus displaying the result 100. In the same way, the working of modulus assignment operator is shown to display the remainder as "$a=$a%8" equal to 4.
A Note
Simple introduction, basic CGI perl programming codes with examples.
Do send your feedback or suggestions on this tutorial.
This is a copyright content.