in reply to Regular expression for combination of data

If you want to make a list from your string, use split:

my @list = split m/,/, $CD;

Then your processing might be easier...