[Chapter 3] Arrays and List Data
Author: Randal L. Schwartz, Erik Olson & Tom Christiansen
Date: 1999-07-02T01:32:43Z

#

| Chapter 3 |

# 3. Arrays and List Data

Contents:
What Is a List or Array?
Literal Representation
Variables
Array Operators and Functions
Scalar and List Context
``<STDIN> as an Array
Variable Interpolation of Arrays
Exercises

## 3.1 What Is a List or Array?

A list is an ordered set of scalar data. An array is a variable that holds a list. Each element of the array is a separate scalar variable with an independent scalar value. These values are ordered - that is, they have a particular sequence from the lowest to the highest element.

Arrays can have any number of elements. The smallest array has no elements, while the largest array can fill all of available memory. Once again, this flexibility is in keeping with Perl's philosophy of "no unnecessary limits."

2.10 Exercises |  | 3.2 Literal Representation