perl-TermReadKey - TermReadKey - A perl module for simple terminal control

Property Value
Distribution CentOS 5
Repository End Point x86_64
Package name perl-TermReadKey
Package version 2.30
Package release 1
Package architecture x86_64
Package type rpm
Installed size 122.57 KB
Download size 61.27 KB
Official Mirror
Term::ReadKey is a compiled perl module dedicated to providing simple
control over terminal driver modes (cbreak, raw, cooked, etc.,) support for
non-blocking reads, if the architecture allows, and some generalized handy
functions for working with terminals. One of the main goals is to have the
functions as portable as possible, so you can just plug in "use
Term::ReadKey" on any architecture and have a good likelyhood of it working.
=over 8
=item ReadMode MODE [, Filehandle]
Takes an integer argument, which can currently be one of the following
0    Restore original settings.
1    Change to cooked mode.
2	 Change to cooked mode with echo off.
(Good for passwords)
3    Change to cbreak mode.
4    Change to raw mode.
5    Change to ultra-raw mode.
(LF to CR/LF translation turned off)
Or, you may use the synonyms:
These functions are automatically applied to the STDIN handle if no
other handle is supplied. Modes 0 and 5 have some special properties
worth mentioning: not only will mode 0 restore original settings, but it
cause the next ReadMode call to save a new set of default settings. Mode
5 is similar to mode 4, except no CR/LF translation is performed, and if
possible, parity will be disabled (only if not being used by the terminal,
however. It is no different from mode 4 under Windows.)
If you are executing another program that may be changing the terminal mode,
you will either want to say
ReadMode 1
ReadMode 1;
which resets the settings after the program has run, or:
ReadMode 0;
ReadMode 1;
which records any changes the program may have made, before resetting the
=item ReadKey MODE [, Filehandle]
Takes an integer argument, which can currently be one of the following
0    Perform a normal read using getc
-1   Perform a non-blocked read
>0	 Perform a timed read
(If the filehandle is not supplied, it will default to STDIN.) If there is
nothing waiting in the buffer during a non-blocked read, then undef will be
returned. Note that if the OS does not provide any known mechanism for
non-blocking reads, then a C<ReadKey -1> can die with a fatal error. This
will hopefully not be common.
If MODE is greater then zero, then ReadKey will use it as a timeout value in
seconds (fractional seconds are allowed), and won't return C<undef> until
that time expires. (Note, again, that some OS's may not support this timeout
behaviour.) If MODE is less then zero, then this is treated as a timeout
of zero, and thus will return immediately if no character is waiting. A MODE
of zero, however, will act like a normal getc.
There are currently some limitations with this call under Windows. It may be
possible that non-blocking reads will fail when reading repeating keys from
more then one console.
=item ReadLine MODE [, Filehandle]
Takes an integer argument, which can currently be one of the following
0    Perform a normal read using scalar(<FileHandle>)
-1   Perform a non-blocked read
>0	 Perform a timed read
If there is nothing waiting in the buffer during a non-blocked read, then
undef will be returned. Note that if the OS does not provide any known
mechanism for non-blocking reads, then a C<ReadLine 1> can die with a fatal
error. This will hopefully not be common. Note that a non-blocking test is
only performed for the first character in the line, not the entire line.
This call will probably B<not> do what you assume, especially with
ReadMode's higher then 1. For example, pressing Space and then Backspace
would appear to leave you where you started, but any timeouts would now
be suspended.
This call is currently not available under Windows.
=item GetTerminalSize [Filehandle]
Returns either an empty array if this operation is unsupported, or a four
element array containing: the width of the terminal in characters, the
height of the terminal in character, the width in pixels, and the height in
pixels. (The pixel size will only be valid in some environments.)
Under Windows, this function must be called with an "output" filehandle,
such as STDOUT, or a handle opened to CONOUT$.
=item SetTerminalSize WIDTH,HEIGHT,XPIX,YPIX [, Filehandle]
Return -1 on failure, 0 otherwise. Note that this terminal size is only for
B<informative> value, and changing the size via this mechanism will B<not>
change the size of the screen. For example, XTerm uses a call like this when
it resizes the screen. If any of the new measurements vary from the old, the
OS will probably send a SIGWINCH signal to anything reading that tty or pty.
This call does not work under Windows.
=item GetSpeeds [, Filehandle]
Returns either an empty array if the operation is unsupported, or a two
value array containing the terminal in and out speeds, in B<decimal>. E.g,
an in speed of 9600 baud and an out speed of 4800 baud would be returned as
(9600,4800). Note that currently the in and out speeds will always be
identical in some OS's. No speeds are reported under Windows.
=item GetControlChars [, Filehandle]
Returns an array containing key/value pairs suitable for a hash. The pairs
consist of a key, the name of the control character/signal, and the value
of that character, as a single character. This call does nothing under Windows.
Each key will be an entry from the following list:
Thus, the following will always return the current interrupt character,
regardless of platform.
%keys = GetControlChars;
$int = $keys{INTERRUPT};
=item SetControlChars [, Filehandle]
Takes an array containing key/value pairs, as a hash will produce. The pairs
should consist of a key that is the name of a legal control
character/signal, and the value should be either a single character, or a
number in the range 0-255. SetControlChars will die with a runtime error if
an invalid character name is passed or there is an error changing the
settings. The list of valid names is easily available via
%cchars = GetControlChars();
@cnames = keys %cchars;
This call does nothing under Windows.


Package Version Architecture Repository
perl-TermReadKey-2.30-8.x86_64.rpm 2.30 x86_64 FlexBox
perl-TermReadKey-2.30-7.PU_IAS.5.i386.rpm 2.30 i386 PUIAS Unsupported
perl-TermReadKey-2.30-7.PU_IAS.5.x86_64.rpm 2.30 x86_64 PUIAS Unsupported 2.30 i386 Atomic 2.30 x86_64 Atomic
perl-TermReadKey-2.30-4.el5.i386.rpm 2.30 i386 EPEL
perl-TermReadKey-2.30-4.el5.x86_64.rpm 2.30 x86_64 EPEL
perl-TermReadKey-2.30-3.el5.rf.i386.rpm 2.30 i386 Repoforge (RPMforge)
perl-TermReadKey-2.30-3.el5.rf.x86_64.rpm 2.30 x86_64 Repoforge (RPMforge)
perl-TermReadKey-2.30-1.el5.rf.i386.rpm 2.30 i386 Repoforge (RPMforge)
perl-TermReadKey-2.30-1.el5.rf.x86_64.rpm 2.30 x86_64 Repoforge (RPMforge)
perl-TermReadKey-2.30-1.i386.rpm 2.30 i386 End Point
perl-TermReadKey - - -


Name Value -
perl(AutoLoader) -
perl(Carp) -
perl(DynaLoader) -
perl(Exporter) -
rtld(GNU_HASH) -


Name Value -
perl(Term::ReadKey) -
perl-TermReadKey = 2.30-1


Type URL
Binary Package perl-TermReadKey-2.30-1.x86_64.rpm
Source Package perl-TermReadKey-2.30-1.src.rpm

Install Howto

  1. Download the latest endpoint-release rpm from
  2. Install endpoint-release rpm:
    # rpm -Uvh endpoint-release*rpm
  3. Install perl-TermReadKey rpm package:
    # yum install perl-TermReadKey




2008-12-20 -
- Initial build.

See Also

Package Description
perl-Test-Pod-1.26-1.noarch.rpm Test-Pod - check for POD errors in files
perl-enum-1.016-1.noarch.rpm enum - C style enumerated types and bitmask flags in Perl
perl-rrdtool-1.2.23-1.rf.x86_64.rpm Perl RRDtool bindings
pfqueue-0.5.6-4.ep.x86_64.rpm Queue manager for the Postfix/Exim Mail Transport Agents
pg_top-3.6.2-1.ep.x86_64.rpm 'top' for PostgreSQL process
php-dbase-5.1.6-4.x86_64.rpm Standard dBase module for PHP applications
php-fpdf-1.6-5.ep.noarch.rpm PHP class to generate PDF Files
php-fpdf-doc-1.6-5.ep.noarch.rpm Documentation for php-fpdf
php-mcrypt-5.1.6-4.x86_64.rpm Standard PHP module provides mcrypt library support
php-mhash-5.1.6-4.x86_64.rpm Standard PHP module provides mhash support
php-mssql-5.1.6-4.x86_64.rpm Standard PHP module provides mssql support
php-pear-Auth-SASL-1.0.2-4.noarch.rpm PEAR: Abstraction of various SASL mechanism responses
php-pear-Auth-SASL-1.0.3-1.ep.noarch.rpm Abstraction of various SASL mechanism responses
php-pear-DB-1.7.13-1.noarch.rpm PEAR: Database Abstraction Layer
php-pear-MDB2-2.4.1-2.noarch.rpm Database Abstraction Layer