3. List flattening and the solution

3.1 Can a list contain another list?

By definition, a list is a collection of single values. Howvere, a list can also contain another list. But this makes little sense: the nested list in a list will be flattened and the list contains only scalar values. This is called: list-flattening.
print(1, (2, 3), (4 .. 7)); # output: 1234567

3.2 The solution

In Chapter 3 it was said that you can use a reference anywhere you could use a scalar. Recall that a reference is a scalar. So, a list can contain a reference! And this means that complex data structures can be constructed.
@mc_list = (4 .. 7);
$aref = \@mc_list;
print("@{$aref}\n"); # output: 4 5 6 7
@CS = (1, (2, 3), $aref);
print("@{$CS[2]}"); # output: 4 5 6 7
The nex chapters will explain this further.