Scalar Context: Lists Versus Arrays
For a long time after I first encountered Perl, I looked on "list" and "array" as essentially interchangeable concepts. A list was simply the source construct corresponding to an array. This idea is mostly correct. But as they say, the devil is in the details.
One of the differences is what happens to them in scalar context. An array evaluates to the number of elements it contains. A list evaluates to its last element. So:
my @array = qw{ one two five };
say scalar @array; # prints '3'
{
no warnings 'void'; # Note the need for this
say scalar( qw{ one two five } ); # prints 'five'
}


