in reply to Removing characters

What is really going on here is that the output from man is designed to be printed on a paper printer. When the output includes something like x^Hx it's because man wants the printer to back up and overprint the x a second time, to render the x in boldface.

It's a big mistake to remove the ^H characters first and then to try to strip the doubled letters, because by removing the ^Hes, you've thrown away the information about which double letters should be stripped. What you want is to take the output from man and simply do this:

$text =~ s/.\cH//g;
That's all. nroff also uses _^Hx to indicate an underlined x character, and this will fix that also.

The other right solution was the one that mr.nick suggested: Use the col -b command to filter out the reverse motions before saving the output.