title: Print progress bar for a script with real time update
body: <p>In my script I check for the existence of elements compared to a set of data that I already have, I do this multiple time, hence the progress bar.</p>
  
  <p>This is what I am doing as of now</p>
  
  <pre><code>### A loop which is done multiple times ### 
  
  my $i =1;
  my $page = 50;
  while ($i &lt;= $page)    
  {
  
  ##### Part where I print my progress bar ######
  print "\rProgress:[";
  my $completed =($i/$page)*100;
  $completed = ceil($completed);
  my $l= $completed;
  while ($l&gt;0){
      print "#";
      $l--;
  }   
  my $remaining = 100-$completed;
  while ($remaining&gt;0){
      print " ";
      $m--;
  } 
  print "] ";
  print $completed . "% Complete";
  
  
  ######### Part where I check and keep count #############
  foreach (@each_job) 
  {
      my $temp = $_;
      # Count number of jobs that exist with my set
      if ($job{"$temp"} == 1) 
      { 
          $does_exist++ ;
          ## print "\n Exists - $does_exist"; #Confused for this print
      }
      else 
      {
          $does_not_exist++;
          ## print "\n Does not exist - $does_not_exist"; #Confused for this print
      };
      };
      $i++;
  }
  </code></pre>
  
  <p>So what I currently get is something like </p>
  
  <pre><code>Progress:[################################################                                                    ] 48% Complete
  </code></pre>
  
  <p>Which works fine and displays the progress bar as a traverse page by page.
  But what I want is something like this -</p>
  
  <pre><code>Progress:[################################################                                                    ] 48% Complete
  Exists - 3
  Does Not Exist - 5
  </code></pre>
  
  <p>Which keeps getting updated at the same spot (using <code>\r</code>). 
  Can someone help me ? </p>