#!/usr/bin/perl -w use strict; use Term::ReadKey; my %hashed; @hashed{'a'..'z'} = 1..26; my @mixed = keys %hashed; ReadMode "raw"; while (my $key = lc(ReadKey(0))){ last if ord($key) == 27; # You can get out if you can figure it out print $mixed[ord($key)-97]; } ReadMode "normal";