in reply to Simultaneous Term::ProgressBars?

Term::ProgressBar updates the progress bar simply by printing a carriage return character before the bar (as far as I can tell from the source). That character just sets the cursor at the beginning of the line again

You can test this with a simple print "\n"; inbetween updates of the bar. Then you should see every progress bar iteration one line after the other, because the new progress bar is printed on the next line instead of the same.

You might be able to use the minor character (see ProgressBar docu) to display progress inside the files if you use it with the linear completion time estimator to just stay inside one step of the major character while using the minor character to go from 0 to 100% for any number of files.

CORRECTION: Sorry, didn't mean linear completion time estimator but the return value of update. If that shows the change value of the major progress bar, then it is possible. If it shows the change value of the minor progress bar too, you are out of luck (and I think the latter case is more likely).

Replies are listed 'Best First'.
Re^2: Simultaneous Term::ProgressBars?
by Anonymous Monk on Aug 14, 2009 at 18:40 UTC
    Printing a "\n" almost works. Adding a print "\e[A" to move up one line gets you the whole way.