Perl Variables
A variable is a symbolic name for a location in memory. A programming language usually defines the types of variables it will allow. For example, in C some types include int, char, float, and double. Java allows similar types. In Perl the situation is a little different.
Perl distinguishes between three different data types. A scalar represents a single value. An array represents an ordered collection of these values indexed from 0. A hash represents an unordered collection of scalars whose values can be indexed by their key. Perl uses punctuation to distinguish between these three kinds of variables.
Perl also differs from many programming languages in that the programmer does not have to define a variable before using it.
Scalar ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access