#!/usr/bin/perl use strict; use warnings; use 5.018; use Term::Readline; my $term_out = "This is a test. This is being written from a terminal. As I write, I get closer to the edge. \nThe prompt continues on the line below without me hitting the return key.\n When I press up with an arrow key, nothing untoward happens on W7 w/perl v 5.018."; my $term = Term::ReadLine->new("APP DESCRIPTION"); my $OUT = $term->OUT|| *STDOUT; $term->addhistory(my $fake_line); my $line = $term->readline("Strike RETURN to continue: "); say $line . $term_out; #### "new" returns the handle for subsequent calls to following functions. Argument is the name of the application. Optionally can be followed by two arguments for "IN" and "OUT" filehandles. These arguments should be globs. "readline" gets an input line, *possibly* with actual "readline" support. Trailing newline is removed. Returns "undef" on "EOF". "addhistory" adds the line to the history of input, from where it can be used if the actual "readline" is present.