#!/usr/bin/perl -- use strict; use warnings; use Tk; my $mw = tkinit(); my $l = $mw->Scrolled(qw' Text -height 2'); $mw->Button( -text => 'add', -command => sub { $l->insert( 'end', localtime() . "\n" ); $l->see('end'); } )->pack; $l->pack; $l->insert( 'end', "hi\nthere\n" ); MainLoop();