This software allows users to print documents with indentation, status, and closure. It is a useful tool for those who need to organize their printed materials in a clear and concise manner.
Using Term::Emit couldn't be simpler. All you need to do is include the following code snippet: use Term::Emit qw/:all/;. From there, you can start emitting messages just like this example: emit "Reconfiguring the grappolator"; do_whatchamacallit(); do_something_else();.
When this code runs, you'll see the following message output: Reconfiguring the grappolator... Whatchamacallit and Something else are processed, and when they are complete, the rest of the line is filled in with dots and [DONE]. The final output will look like this: Reconfiguring the grappolator............................... [DONE].
What's especially nice about Term::Emit is that your custom subroutines can emit messages as well. You can even indicate whether a specific task succeeded or failed. For example, you could create a message output that looks something like this: Reconfiguring the grappolator... Processing whatchamacallit................................ [WARN] Fibulating something else... Fibulation phase one.................................... [OK] Fibulation phase two.................................... [ERROR] Wrapup of fibulation.................................... [OK] Reconfiguring the grappolator............................... [DONE].
If you're wondering how to get started using Term::Emit, the module provides excellent documentation that includes examples, such as this snippet: 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;
When you run this code, you'll see output like this: System parameter updates... CLOCK_UTC................................................. [OK] NTP Servers............................................... [ERROR] DNS Servers............................................... [WARN] System parameter updates.................................... [DONE].
Term::Emit isn't complex to use, and it's evident from reading the module's documentation. Use it to enhance the readability and organization of your scripts, as well as making customized status messages that are easy to parse.
Version 0.0.2: N/A