I suppose I thought it would need something to tell it to look at the contents of @A instead of @A itself.
Quite the reverse. You have to work at it in order to refer to the array rather than its contents. Consider these two separate lines from the code above:
print "intesection is @intersection\n";
Here, despite being contained within a string, it is the contents of the array which are printed, not the array as a container.
my @A = (\@S1, \@S2, \@S3);
Whereas here, we have had to create references to each of the S arrays so that they are not flattened when assigning to @A.
Further reading:
Arrays: A Tutorial/Reference,
perldata,
perlref
|