#!/usr/bin/perlmy $num = 123456789;print comman($num);sub comma { local($_) = @_; 1 while s/(.*\d)(\d\d\d)/$1,$2/; $_;}1;