in reply to simple regex

Here is another way, based on the RE you used:

The trick is to loop looking for groups of 3 digits.

while($col=~s/(\d)(\d\d\d)(,|$)/$1,$2/) {}
Notice - we look of either trailing COMMA or, end of line.

"Experience is a wonderful thing. It enables you to recognize a mistake when you make it again."