use Term::ReadKey; ReadMode 3; $|++; @box = ( (L .. Z), (A .. K)); print "My secret Code: ",join(',',@box),"\n"; while(1) { my $key = ReadKey(-1); $key = uc($key); last if $key eq 'Q'; print $box[ord($key) - 65]; } ReadMode 0;