in reply to eliminating special control characters
if you always need to get rid of the last character on the line, you can use chop($line) to drop the last character. To get rid of ^A (assuming it truly is two different characters), try s/\^A// since the caret signifies the start of a line/variable. Otherwise, if it is a single character, you need to figure out what it is exactly, not how it is represented on output.