my $progress = $mw->Toplevel(); $progress->title("Download progress"); $progress->ProgressBar( -width => 20, -from => 0, -to => 100, -blocks => 100, -colors => [ 0, 'lightgreen' ], -variable => \$percent_done, -length => '300', )->pack( -side => 'bottom', -padx => '10', -pady => '10', ); use InContact::FTP; my $ftp = InContact::FTP->new( "froghollow.net", Timeout => 30, Debug => 0 ) or warn "Can't connect: $@\n"; $ftp->login( 'anonymous', 'guest' ) or die "Couldn't authenticate"; $ftp->cwd("/pub"); $ftp->type("I"); $ftp->hash( \&__callback, 1024, $progress ); $file_size = $ftp->size( 'whatever.exe' ) / 1024; $ftp->get('whatever.exe'); $ftp->quit; $mw->configure( -cursor => 'arrow' ); $mw->update; sub __callback { my ($count, $progress) = @_; $block_count += $count; $percent_done = ( $block_count / $file_size ) * 100; $mw->update(); }