I've RTFM'd and STFW'd but found no enlightenment.
I have successfully been using Term::ProgressBar to monitor my prog's processing of a file. I now want to extend the program to process multiple files. Aha, I thought to myself, it would be nice to have two ProgressBars, one above the other: one to monitor progress through the file set; and one to monitor progress in the file currently being processed. However, this doesn't seem possible. Only one bar is displayed at a time, the last one to be created.
My program is too long long to post here, but here is an example adapted from one of the examples in the Term::ProgressBar package:
#!/usr/bin/perl use warnings; use strict; use Term::ProgressBar 2.00; use constant MAX => 100_000; my $run_progress = Term::ProgressBar->new({name => 'Run', count => 1 +0, remove => 1}); $run_progress->minor(0); my $run_update = 0; for (0..10) # the outer run { my $powers_progress = Term::ProgressBar->new({name => "Powers$_", co +unt => MAX, remove => 1}); $powers_progress->minor(0); my $powers_update = 0; for (0..MAX) { my $is_power = 0; for(my $i = 0; 2**$i <= $_; $i++) { $is_power = 1 if 2**$i == $_; } $powers_update = $powers_progress->update($_) if $_ >= $powers_update; } $powers_progress->update(MAX) if MAX >= $powers_update; $run_update = $run_progress->update($_) if $_ >= $run_update; #print "\n"; }
Running this shows only the powers_progress bars, and not the run_progress bars. Commenting in the print statement on the 2nd to last line displays the run_progress bar as a "snap shot".
Is what I am trying to do even possible? I'm truly stuck on this problem.
Thanks in advance for any help,
poshboy
p.s. this is my first post to the Monks, so please excuse any mistakes I've made!
In reply to Simultaneous Term::ProgressBars? by poshboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |