8.198. Term::ReadLineFrontend to other ReadLine packages. Currently interfaces to Term-ReadLine, which is available on CPAN. Defines the variables $IN and $OUT, which return the filehandles for input and output, respectively, or undef if Readline input and output cannot be used for Perl. Provides the following methods.
$term = new Term::ReadLine 'name' Constructor. Returns the handle for subsequent calls to other ReadLine methods. Argument name is the name of the application. Optionally can be followed by two arguments that are globs specifying input and output filehandles.
$term->addhistory(line) Adds line to the input history.
$term->Features Returns a reference to a hash whose keys are features present in the current implementation and whose values are assigned to each feature. Several optional features are used in the minimal interface:
$term->findConsole Returns array of two strings containing the most appropriate names for input and output files, using the conventions <$in and >$out.
$term->MinLine([size]) With size argument, serves as a recommendation on minimal size of line to be added to history. Without an argument, does not add anything to the history. Returns the old value.
$term->ReadLine Returns the actual package that executes the commands. Some possible values are Term::ReadLine::Gnu, Term::ReadLine::Perl, or Term::ReadLine::Stub.
$term->readline(prompt) Prompts for input line and gets the result. Removes trailing newline and returns undef at end-of-file. Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|