home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeJava and XSLTSearch this book

8.198. Term::ReadLine

Frontend 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.



Adds line to the input history.



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:

Should be present if the first argument to new is recognized

Should be present if MinLine method is not a dummy

Should be present if lines are put into history automatically (maybe subject to MinLine)

Should be present if the addhistory method is not a dummy



Returns array of two strings containing the most appropriate names for input and output files, using the conventions <$in and >$out.



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.



Returns the actual package that executes the commands. Some possible values are Term::ReadLine::Gnu, Term::ReadLine::Perl, or Term::ReadLine::Stub.



Prompts for input line and gets the result. Removes trailing newline and returns undef at end-of-file.

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.