Term::Emit

Print with indentation, status, and closure
Download

Term::Emit Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Steve Roscio
  • Publisher web site:
  • http://search.cpan.org/~roscio/

Term::Emit Tags


Term::Emit Description

Print with indentation, status, and closure Term::Emit is a Perl module used to print balanced and nested messages with a completion status. These messages indent easily within each other, autocomplete on scope exit, are easily parsed, may be bulleted, can be filtered, and even can show status in color.For example, you write code like this: use Term::Emit qw/:all/; emit "Reconfiguring the grappolator"; do_whatchamacallit(); do_something_else();It begins by printing: Reconfiguring the grappolator...Then it does "whatchamacallit" and "something else". When these are complete it adds the rest of the line: a bunch of dots and the . Reconfiguring the grappolator............................... Your do_whatchamacallit() and do_something_else() subroutines may also emit what they're doing, and indicate success or failure or whatever, so you can get nice output like this: Reconfiguring the grappolator... Processing whatchamacallit................................ Fibulating something else... Fibulation phase one.................................... Fibulation phase two.................................... Wrapup of fibulation.................................... Reconfiguring the grappolator............................... A series of examples will make Term::Emit easier to understand.SYNOPSISFor a script like this: use Term::Emit qw/:all/; emit "System parameter updates"; emit "CLOCK_UTC"; #...do_something(); emit_ok; emit "NTP Servers"; #...do_something(); emit_error; emit "DNS Servers"; #...do_something(); emit_warn;You get this output: System parameter updates... CLOCK_UTC................................................. NTP Servers............................................... DNS Servers............................................... System parameter updates.................................... Requirements: · Perl


Term::Emit Related Software