in reply to regexp for adding commas to a number
sub commify { local($_) = shift; 1 while s/^(-?\d+)(\d{3})/$1,$2/; return $_; } [download]
Cheers, KM