ModuleDocumentation/whatbot/Progress.pm

< Back to Module Documentation // View in SVN

NAME

whatbot::Progress - Provides a basic progress meter

SYNOPSIS

 use whatbot::Progress;
 
 my $progress = new whatbot::Progress (
    'restrict_updates' => 10,
    'max'              => 100,
    'show_count'       => 1
 );
 for ( my $i = 0; $i <= 100; $i++ ) {
     $progress->update($i);
 }
 $progress->finish();

DESCRIPTION

whatbot::Progress provides a simple command line progress bar without any dependencies beyond what whatbot requires.

PUBLIC ACCESSORS

restrict_updates
Divisor of the current progress where the progress bar should be updated. Leaving this undefined will cause the progress bar to update every time 'update' is called, otherwise, will only update per multiple.
max
Value of the 100% mark
show_count
Display the current count at the end of the progress bar. This updates depending on the value of

METHODS

update
Update the progress bar with the given value

LICENSE/COPYRIGHT

Be excellent to each other and party on, dudes.