http://www.perlmonks.org?node_id=1040263


in reply to How to print colored word in text file

I need to do this for windows and linux

use Term::ANSIColor qw(:constants); print BOLD, RED, "ERROR!! Muahahahaha!!!\n", RESET; print "I'm fine now, thanks\n";

Note: Term::ANSIColor comes with the perl-modules package in Debian, replacing the old libansicolor-perl package

in a text file

See. i.e. Latex \usepackage{color} and use perl to print the latex command to an outfile.tex, then convert outfile.tex to outfile.pdf with pdflatex