tksleep($mw, 100); sub tksleep { # Like sleep, but actually allows the display to be # updated, and takes milliseconds instead of seconds. my $mw = shift; my $ms = shift; my $flag = 0; $mw->after($ms, sub { $flag++ }); $mw->waitVariable(\$flag); }