Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable color regex debugging in perl on windows

In some of my perl scripts, I've found it necessary to enable regex debugging while I work on them. I've seen that there is a color mode, but I can't seem to get color output. I've added use re 'debugcolor'; to my program, but it seems to behave no different than use re 'debug';.

I'm wondering if cmd.exe doesn't support the color output. Any documentation I've found just says that it will work on a terminal that supports it.

My question boils down to: Is there something else I need to do to enable color output? or, alternatively, What other terminal program could I use instead of cmd.exe?

like image 566
daxlerod Avatar asked Jan 25 '12 21:01

daxlerod


1 Answers

re uses unix's termcap to provide color information. Try:

BEGIN {
   require Win32::Console::ANSI;
   $ENV{PERL_RE_COLORS} = "\e[1m\t\e[0m\t\e[7m\t\e[27m\t\e[4m\t\e[24m";
}

I get some colors from that. I don't know if they're the ones you are expecting.

like image 126
ikegami Avatar answered Oct 13 '22 03:10

ikegami