Tk::CodeText is a TextUndo widget with syntax highlighting capabilities.
my $m = new MainWindow;
my $e = $m->Scrolled('CodeText',
-disablemenu => 1,
-syntax => 'Perl',
-scrollbars => 'se',
)->pack(-expand => 1, -fill => 'both');
$m->configure(-menu => $e->menu);
Tk::CodeText inherits Tk::TextUndo and all its options and methods. Besides syntax highlighting, methods are provided for commenting and uncommenting as well as indenting and unindenting a selected area, matching pairs of braces, brackets and brackets and curlies and automatic indenting of new lines.
Syntax highlighting is done through a plugin approach. Adding languages is a matter of writing plugin modules. Theoretically this is not limited to programming languages. The plugin approach could also provide the possibility for grammar or spell checking in spoken languages.