ProgressIndicator -- Karma System output class
use Karma::Output::ProgressIndicator;
my $pi = ProgressIndicator->at( y, x, width, iterations, Title => '%u%%:', Bar => '#', Backing => ':' );
for $i ( 0 .. iterations ) { $pi->update;
...
if ( oops ) { $pi->backup; $i--; } } $pi->flush;
B<Bar> may be a "c string"; B<Title> is the sprintf format used to display the percent complete portion.
Take note that in this example, the method B<flush()> is used to make the appearance of actual work. This simply adds a pleasing visual effect.
Another interesting point is the use of backup() to take a step back. Just as often one finds it necessary to jump to a specific iteration, and in this case the set() method is appropriate.
Title should be an sprintf format containing one %u, and whatever formatting you desire. Similarly, Bar should be a Karma color string to be displayed upon each iteration. The c string Backing will be printed behind the Progress Indicator, for additional visual impact.