Know-How für Ihr Projekt

Perl Documentation


Term::ReadKey - A perl module for simple terminal control


use Term::ReadKey;
ReadMode 4; # Turn off controls keys
while (not defined ($key = ReadKey(-1))) {
    # No key yet
print "Get key $key\n";
ReadMode 0; # Reset tty mode before exiting


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 likelihood of it working.

Version 2.30.01: Added handling of arrows, page up/down, home/end, insert/delete keys under Win32. These keys emit xterm-compatible sequences. Works with Term::ReadLine::Perl.


Kenneth Albanowski <>

Currently maintained by Jonathan Stowe <>


The code is maintained at

Please feel free to fork and suggest patches.


Prior to the 2.31 release the license statement was:

Copyright (C) 1994-1999 Kenneth Albanowski.
              2001-2005 Jonathan Stowe and others
Unlimited distribution and/or modification is allowed as long as this
copyright notice remains intact.

And was only stated in the README file.

Because I believe the original author's intent was to be more open than the other commonly used licenses I would like to leave that in place. However if you or your lawyers require something with some more words you can optionally choose to license this under the standard Perl license:

This module is free software; you can redistribute it and/or modify it
under the terms of the Artistic License. For details, see the full
text of the license in the file "Artistic" that should have been provided
with the version of perl you are using.
This program is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.