#!/usr/bin/perl use strict; use Tk; my $mw=MainWindow->new; my $percent; my $pb= $mw->Label( -bg => 'white', -fg => 'blue', -width => 60, -justify => 'left', -anchor => 'w', )->pack(); my $label1 = $mw->Label( -textvariable=> \$percent, )->pack(); my $timer = $mw->repeat(10,\&show_progress); MainLoop; sub show_progress{ $percent += 1; if($percent >= 100){$percent = 0} my $str = '|' x $percent; $pb->configure(-text => $str ); }