in reply to How can I change the text color

Files are just streams of bytes. They don't have any concept of colours. Colours can be generated in many ways, but they all have to do with turning on pixels on the screen. Term::ANSIColor is one way of doing it, and it only works when addressing a terminal - and not even any terminal, only those terminals that understand the ANSI way of encoding colours (and assosiated stuff).

So, if you are going to put the escape sequences in a file, to get the pretty colours back, you need to send the escape sequences directly to the terminal. Using cat is one option.

Abigail