in reply to Re: Golf, anyone? :)
in thread disappearing digit with regex and tr

Ooops. Just needs a little positive lookbehind.

perl -le 'for(@ARGV){s/\./,/;s/(?<=\d)(?=(\d\d\d)+(,|\Z))/./g;print}' +1234567.89 234567.89 1234567 234567 1.234.567,89 234.567,89 1.234.567 234.567

update..

Ok.. yours is shorter... mine is probably more efficient for not invoking $& at least :)

                - Ant
                - Some of my best work - (1 2 3)