The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Term::Output::List::Win32 - output an updateable list of ongoing jobs to a Win32 console

SYNOPSIS

    my $printer = Term::Output::List->new();
    my @ongoing_tasks = ('file1: frobnicating', 'file2: bamboozling', 'file3: frobnicating');
    $printer->output_list(@ongoing_tasks);

    $printer->output_permanent("Frobnicated gizmos"); # appears above the list

MEMBERS

fh

Filehandle used for output. Default is STDOUT.

METHODS

Term::Output::List::Win32->new()

width

Width of the terminal. This is initialized at first use. You may (or may not) want to set up a $SIG{WINCH} handler to set the terminal width when the terminal size changes.

->scroll_up

Helper method to place the cursor at the top of the updateable list.

<-output_permanent>>

  $o->output_permanent("Frobnicated 3 items for job 2");
  $o->output_list("Frobnicating 9 items for job 1",
                  "Frobnicating 2 items for job 3",
  );

Outputs items that should go on the permanent record. It is expected to output the (remaining) list of ongoing jobs after that.

<-output_list @items>>

  $o->output_list("Frobnicating 9 items for job 1",
                  "Frobnicating 2 items for job 3",
  );

Outputs items that can be updated later, as long as no intervening output (like from print, say or warn) has happened. If you want to output lines that should not be overwritten later, see </-output_permanent>>

<-fresh_output >>

  $o->fresh_output();

Helper subroutine to make all items from the last output list remain as is.

For compatibility between output to a terminal and output without a terminal, you should use ->output_permanent for things that should be permanent instead.

->do_clear_eol

    $o->do_clear_eol(10); # clear 10 lines from the cursor down

Helper method to clear lines on the terminal.