in reply to Printing Arrays in Scalar Context
The general form is
print(join(", ", @x), "\n"); [download]
Perl provides a shortcut.
local $" = ", "; # Default is " ". print("@x\n"); # Same as: print("@x" . "\n"); # Same as: print(join($", @x) . "\n"); [download]