data data data data 7,843,391.58 xyz xzy xyz .... 12,224,675.68 abc ~~~ ~~~ .... 1,339,203.94 (more data) 21,407,271.2 (more data) 16,728,929.69 16,728,929.69 #### sub addcommas{ my ($text)= $nocomma; $text=reverse $text; $text=~s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; $text=scalar reverse $text; return $text; } #### for ($p = 0; $p < @a_table; $p++){ @a_print = split (/\t/, $a_table[$p]); $nocomma = $a_print[5] / 100; $comma = &addcommas(); print AUDIT "$a_print[0]\t$a_print[1]\t$read_time\t$a_print[3]\t$comma\n"; } # end for loop