As you learned in the previous lesson, scalar values can be either numbers or strings.
In fact, the same value can be interpreted as either a number or a string, depending on the context of its use.
In Perl, scalars are effectively typeless;
perl will freely convert its internal representation of the data as needed.
When the context of an expression demands numeric data,
perl will convert the scalar values to numeric; when the context demands string data,
perl will convert the scalars to strings.
$z = join(':', $x, $y);
# $x is first converted to
# a string then, $z will
# be "3:4"
Click the Quiz link below to take a brief multiple-choice quiz about scalars in context.
Then we will move on to discuss literal types and how they're specified.
Scalars Context - Quiz