Without trying to run your code, I think to do multiple files at once, you should move up to an event-loop system like Curses or POE or Glib or preferably a GUI that can have multiple windows. I'm guessing you are running into a limitation of Term::Progressbar, which probably assumes a single terminal window. You can try to write your own. The following is a single pbar, but you could add another on the same line. Having them one on top of another would get very tricky. I know you can backspace on a line, but I've never seem jumping up 1 line on a terminal without curses.
#!/usr/bin/perl use warnings; $|=1; for my $x(1..100){ print progress_bar( $x,100,25,'='); sleep 1; } sub progress_bar { my ( $got, $total, $width, $char ) = @_; $width ||= 25; $char ||= '='; $num_width = length $total; sprintf "|%-${width}s| Got %${num_width}s bytes of %s (%.2f%%)\r", $char x (($width-1)*$got/$total). '>', $got, $total, 100*$got/$ +total; }
If you are willing to switch to a gui
#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::ProgressBar; my $mw = MainWindow->new(); my $pf = $mw->Frame()->pack(); my $pf1 = $mw->Frame()->pack(); my $foo = 0; my $p = $pf->ProgressBar( -troughcolor => 'black', -fg => 'lightgreen', -blocks => 1, -width => 20, -length => 200, -from => 0, -to => 100, -variable => \$foo, )->pack(-side =>'right'); my $l1 = $pf->Label(-text => '%', -bg => 'black', -fg => 'green', )->pack(-side => 'right'); my $l2 = $pf->Label(-textvariable => \$foo, -bg => 'black', -fg => 'green', -width => 3, )->pack(-side => 'right'); ############################### my $foo1 = 0; my $p1 = $pf1->ProgressBar( -troughcolor => 'black', -fg => 'pink', -blocks => 1, -width => 20, -length => 200, -from => 0, -to => 100, -variable => \$foo1, )->pack(-side =>'right'); my $l3 = $pf1->Label(-text => '%', -bg => 'black', -fg => 'pink', )->pack(-side => 'right'); my $l4 = $pf1->Label(-textvariable => \$foo1, -bg => 'black', -fg => 'pink', -width => 3, )->pack(-side => 'right'); $mw->Button( -text => 'Quit', -command => sub { exit } )->pack; $mw->repeat( 100, sub { $foo = ( $foo + 1 ) % 100; if($foo > 100){$foo = 0} $foo1 = ( $foo1 + 2 ) % 100; if($foo1 > 100){$foo1 = 0} }); MainLoop;

I'm not really a human, but I play one on earth Remember How Lucky You Are

In reply to Re: Simultaneous Term::ProgressBars? by zentara
in thread Simultaneous Term::ProgressBars? by poshboy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.