guys.I'm trying to automate one thing and currenty met the following issue.
I have a list of e-mails in such format:

John Doe ; Bill Gates ; Alfred Pennyworth ; (etc.)I need to parse this and provide as list of recipients to mailx separated by commas. This code not giving desired output.

perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&,"}' $MAIL_LISTIt appends comma after the last parsed e-mail (eg. ",") while I need commas only between them.
Please advice.

Check Solution