I said in my original post that it will be outputted into an RTF file (.rtf). So Term::ANSIColor wouldn't work. Even if I was using a terminal, not many useful features are supported in the Windows DOS (which I'm using).
If you want to write some formatted output to an RTF file then you have 2 options:
Learn about the RTF file format and write a method which transforms your original text into this format
Use an existing module which already does that. Searching for "rtf" on CPAN returns many results, so going through these results would be a good first step
Maybe I also misunderstood your question, but to me it sounds like that's all you want