Numbers
Numbers are integers (1, 2, 5) and floats (1.2, 1e5). There is no real difference between them. Perl treats them the same and autoconverts automatically.
Try printing the following numbers:
say 1; say 4.4; say 1.2e10;
As you can see the statements are ended with ;
. This is like a dot that we use to separate sentences.
Arithmetic operators
Basic arithmetic manipulations include: +
(addition), -
(subtraction), *
(multiplication), /
(division), **
(exponent) and %
(modulus).
say 1 + (10/5) * 3
Exercise
Print out the result of 5 to the power of 6.
say