in reply to ascii colors from text file

Detecting the '\\033' sequence and replacing it with a real Esc seems to work. I store the colours in a hash table for easy access.

use strict; use warnings; my %colours = map { $_->[0] => map { my $str = $_; $str =~ s{\\\\(\d{3})}{chr(oct $1)}e; $str } $_->[1] } map { chomp; [ split m{=} ] } <DATA>; print qq{Black then$colours{color2} red then$colours{color1} black.\n} +; __END__ color1=\\033[0;30m color2=\\033[0;31m

I hope this is of use.

Cheers,

JohnGG