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::ReadLine::Perl5 - A pure Perl implementation GNU Readline

SYNOPSIS

  use Term::ReadLine::Perl5;
  $term = new Term::ReadLine::Perl5 'ProgramName';
  while ( defined ($_ = $term->readline('prompt>')) ) {
    ...
  }

DESCRIPTION

Overview

This is a implementation of the GNU Readline/History Library written entirely in Perl.

GNU Readline reads lines from an interactive terminal with emacs or vi editing capabilities. It provides as mechanism for saving history of previous input.

This package typically used in command-line interfaces and REPLs (Read, Eval, Print Loops).

INSTALL

To install this module type:

    perl Makefile.PL
    make
    # for interactive testing:
    make test
    # for non-interactive testing
    AUTOMATED_TESTING=1 make test
    make install # might need sudo make install

For interactive testing try redirect STDIN and/or STDOUT.

If you see something like:

    Can't ioctl TIOCGETP: Invalid argument at ...

install Term::ReadKey

HISTORY

Thi first implementation was in Perl4 (mostly) by Jeffrey Friedl. He referenced FSF the code Roland Schemers line_edit.pl.

Ilya Zakharevich turned this into a Perl5 module called Term::ReadLine::Perl. Some of the changes he made include using Term::ReadKey if present, and made this work under xterm. The file Term/ReadLine/Perl5/CHANGES contains a list of his changes.

BUGS

Bugs are accepted via Github: https://github.com/rocky/p5-Term-ReadLine-Perl5/issues

LICENSE

See the contents of the file LICENSE