use Tk; my  $MamaGUI = new MainWindow; $MamaGUI->repeat(250, \&test ); MainLoop(); sub test { print "test\n"; }