#! /usr/bin/perl -w use Tk; use POE qw(Session); my $main = MainWindow->new(     -background => 'white',     -title => "Ein kleiner test" ); my $text = $main->Label(     -text => "Jede Sekunde eine neue Zahl",     -width => 10,     -height=> 10 )->pack(); POE::Session->create( 'inline_states' =>       { '_start' => \&test       },          'args' => [ "hi" ], ); sub test {     for (1..5) {         sleep(1);         conf($_);     } } POE::Kernel->run(); sub conf {     $text->configure(-text => $_[0]); } MainLoop;