I have a Perl script that uses Term::ANSIColor. It used to be that if I redirect the output to a file > file.txt, then the file contains only text, not color codes^[[0m
Something has changed on my machine, Ubuntu 10.04, so the redirected output includes these special characters that define the color.
Any idea how to fix this? Can I detect redirection of output from inside a perl script and skip the color part?
Thank!
source
share