Loading Progress in perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deva6985
    New Member
    • Jul 2012
    • 1

    Loading Progress in perl

    I have use this code to make the progress bar.its working terminal i cant get the out put in web browser.

    I gonna use this code If you know the answer please hepl me:

    Code:
    use Tk;
    use Tk::WaitBox;
    use Tk::ProgressBar;
    # print "test1";
    
    my $mw="";
    $mw = MainWindow->new(-title => 'ProgressBar example');
    # print "test2";
    $progress = $mw->ProgressBar(
            -width => 30,
            height => 80,
            -from => 0,
            -to => 100,
            -blocks => 50,
            -colors => [0, 'red' , 30, 'red' , 50, 'green' , 80, 'green'],
            -variable => \$percent_done
        )->pack(-fill => 'x');
        
    #   $mw->Button(-text => 'Go!', -command=> sub {
    $arraycount=10000;
    $percentcalculation=$arraycount/100;
      for ($i = 0; $i < $arraycount; $i++) 
      {
         $percent_done = $i/$percentcalculation;
         print "$i\n";
         $mw->update;  # otherwise we don't see how far we are.    
        
      }
    Last edited by numberwhun; Jul 24 '12, 09:27 AM. Reason: Please use Code Tags around the code you place in the forums!
Working...