A list of scalars is constructed by a set of scalar values which are separated by commas and enclosed in parentheses. For example, the following statement assigns a list of two elements to the variable greetings:
@greetings = ("hello", "world");
The most important instruction when working with arrays is the foreach statement. It is a kind of a for loop which is processed once for each element of the list. The appropriate element is assigned to the loop variable or to $_ if no loop variable is given.