my @a = (1,2,3,4,5);
print @a; #output: 12345
print \"\\n\";
print \"@a\"; #output: 1 2 3 4 5
Printing an array by putting its name with
When an array is interpolated in a string, the assumption is you may want to be able to visually distinguish elements; when you print a list, the assumption is you just want that data output contiguously. Both are configurable; $, (default '') is inserted between elements of a list being printed, while $" (default ' ') is inserted between elements of an array interpolated into a string.