use Tk; $mw = new MainWindow; $rec1 = $mw->Canvas(-height => "90", -width => "450")->pack(); @junk = (0,1,2,3,4,5,6,7,8,9); foreach $n (@junk) { delay_type($n); } MainLoop; sub delay_type { $mw->after(500); $rec1->createRectangle(1,1,450,90, -fill => "black"); $rec1->createText(225,45, -text => "$n", -justify => "center", -fill => "yellow", -font => "times 62"); print $n; }