Perl variable names typically consist of alphanumeric characters and underscores. Lower case names are used for most variables, and upper case for global constants.
The statement use strict; is used to make Perl require variables to be pre-declared and to avoid certain types of programming errors.
There are three types of Perl variables: scalars, arrays, and hashes.
Scalars are single items of data and are indicated by a dollar sign ($) at the beginning of the variable name.
Scalars can contain strings, numbers, etc
Strings must be delimited by quote marks. Using double quote marks will allow you to interpolate other variables and meta-characters such as \n (newline) into a string. Single quotes do not interpolate.
Arrays are one-dimensional lists of scalars and are indicated by an at sign (@) at the beginning of the variable name.
Arrays are initialised using a comma-separated list of scalars inside round brackets.
Arrays are indexed from zero
Item n of an array can be accessed by using $arrayname[n]
The index of the last item of an array can be accessed by using $#arrayname.
The number of elements in an array can be found by interpreting the array in a scalar context, eg my $items = @array;
Hashes are two-dimensional arrays of keys and values, and are indicated by a percent sign (%) at the beginning of the variable name.
Hashes are initialised using a comma-separated list of scalars inside curly brackets. Whitespace and the => operator (which is syntactically identical to the comma) can be used to make hash assignments look neater.
The value of a hash item whose key is foo can be accessed by using $hashname{foo}
Hashes have no internal order
$_ is a special variable which is the default argument for many Perl functions and operators
The special array @ARGV contains all command line parameters passed to the script
The special hash %ENV contains information about the user's environment.