I'd like to print out the strings in an array seperated by commas. The following code would work, except that the final comma is not followed by an element.
foreach my $e (@elements)
print $e . ", ";
How can I write code that does not print the final comma? Thanks.