http://www.perlmonks.org?node_id=455004


in reply to Removing dots

This would remove all dots except the rightmost one:
s/\.(?=.*\.)//g;
A single dot occuring only once in the string will not be removed.