use Tk; my $mw = tkinit; my $t = $mw->Text()->pack; $t->tagConfigure('foo', -background => 'yellow'); $t->insert('end',"foo\nbar\nbaz\nfoo\n"); $t->FindAll(qw/-exact -case foo/); $t->tagAdd('foo',$t->tagRanges('sel')); MainLoop;