prev next prev next
  Course navigation
  Lesson 13 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:
  1. arrays and
  2. hashes.
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 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.
The next lesson will go into detail about working with arrays, and the lesson following that will explore hashes.
  Course navigation