Perl has three variable types: scalars, arrays, and hashes. A different character is used to signify each variable type, so you can have the same name used with each type at the same time.
Scalar variables are indicated with the
$ character, as in
$penguin. Scalars can be numbers or strings, and they can change type from one to the other as needed. If you treat a number like a string, it becomes a string. If you treat a string like a number, it is translated into a number if it makes sense to do so; otherwise, it usually evaluates to
0. For example, the string
"76trombones" evaluates as the number
76 if used in a numeric calculation, but the string
"polar bear" evaluates to
Perl arrays are indicated with the
@ character, ...