in reply to String removal

Please read How do I post a question effectively?. In particular, the code you've posted doesn't compile.
$output (" show interfaces terse | match $interface");
is not valid Perl.

Regarding your original question, the likely cause of your issue is that . is a metacharacter in regular expressions that means 'Match any character'. If you want a literal ., you need to escape it with \, as described in Quoting metacharacters. You probably also want to anchor it to the end of the string with $.

s/\.\d+$//;

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.