Recipes for Structures
The following sections present some of the more common arrangements of lists and hashes into structures.
An Example: List of Lists
Lists of lists in Perl are often used to represent a common structure called a two- dimensional array. That is, a normal array is a linear list of values, as illustrated here:
A two-dimensional array is like a grid of values in which each element is addressed like a point on an axis. The first part of the index indicates a row number (starting with 0), and the second is the column, as you can see here:
Perl doesn't really support a true two-dimensional array. What Perl does allow you to ...
Get Sams Teach Yourself Perl in 24 Hours now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.