Hi,
I'm trying to figure out a simple way to print a list seperated by commas (from an array), but I don't want a comma after the last value.
one, two, three, four, five,
to
one, two, three, four, five
Thanks in advance
I'm trying to figure out a simple way to print a list seperated by commas (from an array), but I don't want a comma after the last value.
Code:
@array = ('one','two','three','four','five');
foreach my $word (@array) {
print "$word " . ",";
}
one, two, three, four, five,
to
one, two, three, four, five
Thanks in advance