# Multiple elements value assignment, which creates an array with four elements, some numeric and some string.
@array = (25, "John", "Mary", -45.34); print "$array\n"; # John # Direct assignment of an element with a specific index.
Each numbered item is called an element of the array, and the number assigned this element is called its index.
In per arrays have a special sigil(the prefix of the name) -- @, For example In compiled languages typically all elements of array should have the same type (and thus the same the size in bytes).
In the above example, $stuff refers to the first array reference ['one', 'two', 'three' ...], $stuff refers to the second array reference [7, 6, 5] and so on.
After adding the subscript to get you to the right reference, just add another index to go to the right element in that sub-array.
The follow example initializes and uses a multidimensional array in Perl; -- actually simply an array of references.
You can see that our "array of arrays" is actually an array of references to arrays.
Thus, when you assign values only to the first and, say, 1000th elements of an array, Perl will allocate memory only for two elements, not for 1000 elements.
In case the elements of the array are strings, another good model of understanding of what Perl array is the buffer of the text editor.