2.16 数値の位取りのカンマを挿入する

sub commify {
  my $text = reverse $_[0];
  $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,g;
  return scalar reverse $text;
}