$str = "\033"; # ESC $str = chr(033); # ESC #### while () { s/\\\\033/\033/g; # \\033 -> ESC print; } __DATA__ \\033[0;30mcolor1 \\033[0;31mcolor2