sub long_sub { print "1\n"; &long_sub(); } $main->button( -text => "Start Long-Sub", -command => \&long_sub)->pack;