Perl: Difference Between List and Array

By Xah Lee. Date: . Last updated: .

What is the difference between list and array?

Lists in Perl are not data structures, they are positions in the source code, determined by the context around them. Lists are basically the transient structures that Perl uses to move data around. You interact with them with all of Perl's syntax, but you can not work with them as a data type. The data type that is closest to a list is an array.

source: http://stackoverflow.com/questions/6023821/perl-array-vs-list

here's a better detailed article: [perl array vs list By Michael Schwern. At https://www.socialtext.net/perl5/array_vs_list , accessed on 2013-02-23 ]. Quote:

in Perl, lists and arrays are not strictly the same thing. Though they will often be referred to interchangeably.

In internals sense an array is something that has a corresponding AV, which means that it can referenced and modified. A list is a temporary construct of an unmodifiable set of values on the stack.

Thus in the code

@foo = ( $a, $b, $c );

the left hand side of the = is an array, the right hand side is a list.