use Tk::TextANSIColor; $wid = $mw->TextANSIColor(?options,...?); $wid->insert($pos, $string, ?taglist, ?string, ?taglist); $string_with_escape_codes = $wid->getansi('0.0','end'); use Term::ANSIColor; $red = color('red'); # Retrieve color codes $bold = color('bold'); $wid->insert('end', "$red red text $bold with bold\n");