#instead of: for (1..100000) { sleep 1; } $mw->update(); #do for (1..100000) { sleep 1; $pb->update($_); #update progressbar $mw->upddate(); }