in reply to Re^2: ascii colors from text file
in thread ascii colors from text file
In a double quoted string literal, \033 is replaced with character 33 oct (27 dec, 1B hex) in the resulting string. The following two statememts are equivalent.
$str = "\033"; # ESC $str = chr(033); # ESC
You'll have to do this conversion somehow.
while (<DATA>) { s/\\\\033/\033/g; # \\033 -> ESC print; } __DATA__ \\033[0;30mcolor1 \\033[0;31mcolor2
|
|---|