#!/usr/bin/winperl use warnings; use strict; use Tk; use Tk::ProgressBar; my $w = MainWindow->new(); my $p = $w->ProgressBar( -blocks => 1, -width => 20, -length => 200, -from => 0, -to => 100, -variable => \(my $foo), )->pack(); $foo = 0; $w->repeat(10, sub { $foo = ($foo + 1) % 100 }); MainLoop;