*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> perl5/Term::ReadLine (3)              


Term::ReadLine(3)					     Term::ReadLine(3)

NAME    [Toc]    [Back]

     Term::ReadLine - Perl interface to	various	readline packages. If no real
     package is	found, substitutes stubs instead of basic functions.

SYNOPSIS    [Toc]    [Back]

       use Term::ReadLine;
       $term = new Term::ReadLine 'Simple Perl calc';
       $prompt = "Enter	your arithmetic	expression: ";
       $OUT = $term->OUT || STDOUT;
       while ( defined ($_ = $term->readline($prompt)) ) {
	 $res =	eval($_), "\n";
	 warn $@ if $@;
	 print $OUT $res, "\n" unless $@;
	 $term->addhistory($_) if /\S/;

DESCRIPTION    [Toc]    [Back]

     This package is just a front end to some other packages. At the moment
     this description is written, the only such	package	is Term-ReadLine,
     available on CPAN near you. The real target of this stub package is to
     set up a common interface to whatever Readline emerges with time.

Minimal	set of supported functions
     All the supported functions should	be called as methods, i.e., either as

       $term = new Term::ReadLine 'name';

     or	as


     where $term is a return value of Term::ReadLine->Init.

     ReadLine	 returns the actual package that executes the commands.	Among
		 possible values are Term::ReadLine::Gnu,
		 Term::ReadLine::Perl, Term::ReadLine::Stub Exporter.

     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.

     IN, $OUT	 return	the filehandles	for input and output or	undef if
		 readline input	and output cannot be used for Perl.

									Page 1

Term::ReadLine(3)					     Term::ReadLine(3)

     MinLine	 If argument is	specified, it is an advice on minimal size of
		 line to be included into history.  undef means	do not include
		 anything into history.	Returns	the old	value.

     findConsole returns an array with two strings that	give most appropriate
		 names for files for input and output using conventions
		 "<$in", ">out".

     Attribs	 returns a reference to	a hash which describes internal
		 configuration of the package. Names of	keys in	this hash
		 conform to standard conventions with the leading rl_

     Features	 Returns a reference to	a hash with keys being features
		 present in current implementation. Several optional features
		 are used in the minimal interface: appname should be present
		 if the	first argument to new is recognized, and minline
		 should	be present if MinLine method is	not dummy.
		 autohistory should be present if lines	are put	into history
		 automatically (maybe subject to MinLine), and addhistory if
		 addhistory method is not dummy.

		 If Features method reports a feature attribs as present, the
		 method	Attribs	is not dummy.

Additional supported functions    [Toc]    [Back]

     Actually Term::ReadLine can use some other	package, that will support
     reacher set of commands.

     All these commands	are callable via method	interface and have names which
     conform to	standard conventions with the leading rl_ stripped.

     The stub package included with the	perl distribution allows some
     additional	methods:

     tkRunning	 makes Tk event	loop run when waiting for user input (i.e.,
		 during	readline method).

     ornaments	 makes the command line	stand out by using termcap data.  The
		 argument to ornaments should be 0, 1, or a string of a	form
		 "aa,bb,cc,dd".	 Four components of this string	should be
		 names of terminal capacities, first two will be issued	to
		 make the prompt standout, last	two to make the	input line

     newTTY	 takes two arguments which are input filehandle	and output
		 filehandle.  Switches to use these filehandles.

     One can check whether the currently loaded	ReadLine package supports
     these methods by checking for corresponding Features.

									Page 2

Term::ReadLine(3)					     Term::ReadLine(3)

EXPORTS    [Toc]    [Back]


ENVIRONMENT    [Toc]    [Back]

     The variable PERL_RL governs which	ReadLine clone is loaded. If the value
     is	false, a dummy interface is used. If the value is true,	it should be
     tail of the name of the package to	use, such as Perl or Gnu.

     If	the variable is	not set, the best available package is loaded.

     no	real package is	found, substitutes stubs instead of basic functions."

									PPPPaaaaggggeeee 3333
[ Back ]
 Similar pages
Name OS Title
dpkg-name Linux rename Debian packages to full package names
perlmod IRIX Perl modules (packages and symbol tables)
perlmod OpenBSD Perl modules (packages and symbol tables)
overload IRIX Package for overloading perl operations
stfe Tru64 routines that provide a high-level interface to basic functions needed to access and add to the symb...
stfe IRIX routines that provide a high-level interface to basic functions needed to access and add to the symbol table
su Tru64 Substitutes user ID temporarily
perljp OpenBSD AEuEU,i Perl Y~YxYE `A^a`I`A Perl xIAx3|xOxex|x3x1/2! Perl 5.8.0 xexeicUni- _ codeYuYYi1/4YEx~AcEyxE...
Devel::SelfStubber IRIX generate stubs for a SelfLoading module
VkPrefRadio IRIX Radio box interface for preference package
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service