in reply to stripping "." from amounts

This line of your code does not do what you think it does:
if ($_[0] =~ m/./)
The unadorned period character in a regex is a "wildcard": it will match any single character (including a literal period, of course, but also a space, any digit, letter, punctuation mark, control code or any other symbol). If you put a backslash in front of the period in the regular expression, it will match only the literal period.

The topic of special characters (and how to "escape" them so that they are not treated as "special") is pretty basic stuff you have to learn about regular expressions. Have you looked at perlretut yet?

(But apart from that, I agree with others that there are better ways to remove the fractional part of a numeric string.)