![]() |
||
|
|
Aggregate data types | |
|
Objective
|
Learn what the two basic aggregate data types are in Perl. | |
|
Sometimes it does not suffice to store a single dimension of data. Many times data come in groups, in pluralities, like raindrops
beating on the tin roof of the carport while you're trying to sleep.
For these purposes, Perl has two basic aggregate data types:
The simpler form is the array. It's simply a two-dimensional scalar. Indexed numerically, starting at zero, the contents of a
Perl array is simply an ordered list of scalar variables.
The next lesson will go into detail about working with arrays, and the lesson following that will explore hashes.
The more complex form is the hash (also called associative array, but hash is so much simpler, don't you think?). A hash is like an array, but it's indexed with scalar values instead of numbers. |
||
|
|
||