in reply to Global replace issue

instead of using subs you could do the calculations in the regex itself. and to keep things sane have one regex for C and another for F. you could have a regex with calc for both C and F combined but that would be quite ugly.
the hardest line to type correctly is: stty erase ^H