in reply to String removal
is not valid Perl.$output (" show interfaces terse | match $interface");
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.
|
|---|