Nested Data Structures

Learn about nested data structures in Perl.

Storing an array in an array

Perl’s aggregate data types—arrays and hashes—store scalars indexed by integer or string keys. Note the word scalar. If we try to store an array in an array, Perl’s automatic list flattening will make everything into a single array:

Get hands-on with 1400+ tech skills courses.