Another newbie question:
From an array, how do I generate a CSV? I use a foreach loop, but it will add an extra "," after the last number, as the example below:
my @array = (1,2,3,4,5);
foreach my $num (@array){
print $num = $num . ",";
}
output:1,2,3,4,5,
How should I approach this? Thanks.
Allen
From an array, how do I generate a CSV? I use a foreach loop, but it will add an extra "," after the last number, as the example below:
my @array = (1,2,3,4,5);
foreach my $num (@array){
print $num = $num . ",";
}
output:1,2,3,4,5,
How should I approach this? Thanks.
Allen