#!/usr/bin/perl use strict; use warnings; use Tk; use IO::File; my $mw = MainWindow->new(); my $st = $mw->Scrolled( 'Text', -scrollbars => 'eo' )->pack(); $st->repeat( 3000, \&list ); MainLoop; sub list { my $fh = IO::File->new(); open $fh, q{<}, '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Tk/Text.pm'; while (<$fh>) { $st->insert( 'end', "line $_\n" ); return; } } 1;