It makes me wonder what else has snuck into tables I've been working with all because the invisible character wasn't at the end where I'm regularly look to clean up.
Rather than cutting out unwanted characters, you may want to only match what you know to be ok for the entire line. For example, if you want only printable non-whitespace characters, then match only that (see "perldoc perlre" for more details). Also, you may want to warn/die if you find characters in a line that you don't think should be there.