When pulling an element out of a list array, we create a scalar variable with the same name as the array, prefixed with the usual dollar sign that denotes scalar variables.
For example, the first element of the array @available_colors is accessed as $available_colors.
Notice that the first element is accessed with a zero. This is important. List arrays begin counting at zero, not one. Thus, $available_colors is a variable placeholder for the word "red". Likewise, $available_colors equals "green" and $available_colors equals "blue".
|Previous | Next | Table of Contents|