I have a string containing: $to = "$a,$b,$c,$d,$e".
$a through $e contain multiple email addresses separated by commas, no space in te $to line.
If $a is present then the initial value of the $to would be: $to = ",email1@place,com,....."
$to =~ s/^,//;
$to =~ s/,,/,/;
Which seems to work however, if the string is $to = ",b,c,,,", it will return $to = "b,c,," not $to = "b,c"
I even tried: $to =~ s/,+/,/;