Scalars in Perl are variables that hold a single value: a string, number, or reference. They start with a $
symbol.
Use my
to declare scalars locally.
Double quotes allow variable interpolation, while single quotes print literals.
Perl can perform arithmetic operations on numeric scalars.
$
whether holding numbers, strings, or references.