in reply to Examples of top command written in Pure PERL
If by "top-ish" command, you mean the output of a heading and then a set of elements below, I wrote a module for that which I haven't published yet. There are also other terminal toolkits like Tickit.
Before I paste the wall-of-text that is my module, can you explain a bit more what you want?
Most of my module reduces to:
has 'term_scroll_up' => ( is => 'lazy', default => sub { $_[0]->terminfo->Tputs('UP') }, ); has 'term_clear_eol' => ( is => 'lazy', default => sub { $_[0]->terminfo->Tputs('ce') }, );
and the idea is to output the list, and then scroll the cursor back up to where we started printing that list.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Examples of top command written in Pure PERL
by davidfavor (Initiate) on Jan 26, 2022 at 16:06 UTC |