Term-Sk Version 0.11
This is a Perl extension for displaying a progress indicator on a terminal.
SYNOPSIS
use Term::Sk;
my $ctr = Term::Sk->new('%d Elapsed: %8t %21b %4p %2d (%8c of %11m)',
{quiet => 0, freq => 10, base => 0, target => 100, pdisp => '!'})
or die "Error 0010: Term::Sk->new, ".
"(code $Term::Sk::errcode) ".
"$Term::Sk::errmsg";
$ctr->up for (1..100);
$ctr->down for (1..100);
$ctr->whisper('abc');
my last_line = $ctr->get_line;
$ctr->close;
print "Number of ticks: ", $ctr->ticks, "\n";
EXAMPLES
Term::Sk is a class to implement a progress indicator ("Sk" is a short form for "Show Key"). This is used to provide immediate feedback for
long running processes.
A sample code fragment that uses Term::Sk:
use Term::Sk;
print qq{This is a test of "Term::Sk"\n\n};
my $target = 2_845;
my $format = '%2d Elapsed: %8t %21b %4p %2d (%8c of %11m)';
my $ctr = Term::Sk->new($format,
{freq => 10, base => 0, target => $target, pdisp => '!'})
or die "Error 0010: Term::Sk->new, ".
"(code $Term::Sk::errcode) ".
"$Term::Sk::errmsg";
for (1..$target) {
$ctr->up;
do_something();
}
$ctr->close;
sub do_something {
my $test = 0;
for my $i (0..10_000) {
$test += sin($i) * cos($i);
}
}
INSTALLATION
To install this module, run the following commands:
perl Build.PL
perl Build
perl Build test
perl Build install
SUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the
perldoc command.
perldoc Term::Sk
You can also look for information at:
RT, CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Term-Sk
AnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/Term-Sk
CPAN Ratings
http://cpanratings.perl.org/d/Term-Sk
Search CPAN
http://search.cpan.org/dist/Term-Sk/
COPYRIGHT AND LICENCE
Copyright (C) 2008 Klaus Eichner
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.