For completeness:
my @a = qw/foo bar quz/;
print "----- 1 -----\n";
print @a; # "foobarquz"
print "\n----- 2 -----\n";
print scalar @a; # "3"
print "\n----- 3 -----\n";
print @a , "\n"; # "foobarquz"
print "----- 4 -----\n";
print @a . "\n"; # "3"
print "----- 5 -----\n";
print "@a"; # "foo bar quz"
print "\n----- 6 -----\n";
$" = "&";
print "@a\n"; # "foo&bar&quz"
print "----- 7 -----\n";
$, = "%";
print @a , "\n"; # "foo%bar%quz%"
print "----- -----\n";
- @a is in list context and provides the arguments to print, which simply outputs them one after the other.
- @a is forced to scalar context, and an array in scalar context returns the number of its elements.
- The same as 1. except there's an additional argument, "\n", compare this to the next case.
- The dot operator (.) concatenates two strings, and here @a is forced into scalar context the same way the scalar function does in 2.
- String interpolation of an array is like doing join($", @a) (see perldata).
- Same as 5. except we've fiddled with $" (the list separator) for demonstration purposes.
- Here's an interesting one not yet mentioned: $, (the output field separator) is what print outputs between its arguments. The extra % at the end is because that's output between the last element of @a and the \n.