#!/usr/bin/perl -w use Tk; $wind = MainWindow->new(); $wind->Label( -text => 'Some text' )->pack(); $wind->Button( -text => "Click!", -command => \&display )->pack(-side => 'left'); $text = $wind->Text(-width => 40, -height => 4)->pack(); $text->bind('', \&display); sub display { $text->insert('end', "Hello, Tk!"); } MainLoop;