in reply to Printing Arrays in Scalar Context

The general form is

print(join(", ", @x), "\n");

Perl provides a shortcut.

local $" = ", "; # Default is " ". print("@x\n"); # Same as: print("@x" . "\n"); # Same as: print(join($", @x) . "\n");