use strict; use warnings; use Tk; my $mw = MainWindow->new; my $text = $mw->Scrolled("Text")->pack; foreach my $num (0..20) { $text->insert("end", $num. chr($num) . "\n"); } $mw->Button( -text => 'Quit', -command => sub { exit }, )->pack; MainLoop;