O'Reilly logo

Sams Teach Yourself Perl in 21 Days, Second Edition by Rafe Colburn, Laura Lemay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Nested Data Structures with References

Subroutines are not the only place where references come in handy. The other significant feature that becomes possible with references is complex data structures such as multi-dimensional arrays. In this section we'll look at constructing complex data structures with nested arrays and hashes using references and anonymous data. Later in the lesson, in “Accessing Elements in Nested Data Structures,” we'll look at getting data back out of the nested data structures you've just created.

What Is a Nested Data Structure?

Normally in Perl, lists, arrays, and hashes are flat, one dimensional, containing nothing but scalars. Combine multiple lists, and they all get squished down to a single one. Hashes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required