Term::Report

Easy way to create dynamic 'reports' from within scripts
Download

Term::Report Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Shay Harding
  • Publisher web site:
  • http://search.cpan.org/~shayh/

Term::Report Tags


Term::Report Description

Easy way to create dynamic 'reports' from within scripts Term::Report is a Perl module that can be used to generate nicely formatted dynamic output. It can also use Term::StatusBar to show progress and Number::Format so numbers show up more readable. All output is sent to STDOUT by default.The current release may not be compatible with previous code. Many changes were made with regards to how output could be formatted.SYNOPSIS use Term::Report; use Time::HiRes qw(usleep); my $items = 100; my $report = Term::Report->new( startRow => 4, numFormat => 1, statusBar => , ); my $status = $report->{statusBar}; $status->setItems($items); $status->start; $report->savePoint('total', "Total widgets: ", 1); $report->savePoint('discarded', "\n Widgets discarded: ", 1); for (1..$items){ $report->finePrint('total', 0, $_); if (!($_%int((rand(10)+rand(10)+1)))){ $report->finePrint('discarded', 0, ++$discard); $status->subText("Discarding bad widget"); } else{ $status->subText("Locating widgets"); } usleep(75000); $status->update; } $status->reset({reverse=>1, subText=>'Processing widgets', setItems=>($items-$discard), start=>1}); $report->savePoint('inventory', "\n\nInventorying widgets... ", 1); for (1..($items-$discard)){ $report->finePrint('inventory', 0, $_); $status->update; } $report->printBarReport( "\n\n\n\n Summary for widgets: \n\n", { " Total: " => $items, " Good Widgets: " => $items-$discard, " Bad Widgets: " => $discard, } ); Requirements: · Perl


Term::Report Related Software