#! c:/perl/bin/perl.exe -slw use strict; use warnings; use Tk; use Tk::ProgressBar; my $mw= MainWindow->new (-title=> 'Main Window'); $mw->geometry('900x700'); my $percent_done=0; my $count = 0; chomp (my @data=); my $toplevel = $mw->Toplevel; my $Progress = $toplevel->ProgressBar( -width => 30, -from => 0, -to => 100, -blocks => 50, -colors => [0,'blue',100,'blue'], -variable => \$percent_done)->pack(-fill=> 'x'); $toplevel->focus; for (@data) { print STDOUT "$_\n"; $percent_done =$count/scalar(@data)*100; sleep(1); $count++; $toplevel->update; } $toplevel->destroy; MainLoop; __DATA__ winhost1 winhost2 winhost3 winhost4