$wid->tag('bind', "black"); $wid->tag('bind', "red"); $wid->tag('bind', "green"); $wid->tag('configure', "black", -foreground=>"black"); $wid->tag('configure', "red", -foreground=>"red"); $wid->tag('configure', "green", -foreground=>"darkgreen"); $wid->insert("end",$_,$color); # where $color can be "black", "red", or "green"