in reply to Reading Single Character Input with Term::ReadKey
Try changing "^H" for "\cH" or "\x08". "^H" is just a 2 character string consisting of the characters '^' & 'H'. The other two are escape sequences that perl interprets at compile time and substitutes the approriate single control chracter, chr(8).
Indeed, it might be clearer to others and yourself later if you used
if ($key eq chr(8) ) { #Help Mode!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading Single Character Input with Term::ReadKey
by Fletch (Bishop) on Apr 17, 2007 at 18:25 UTC | |
by BrowserUk (Patriarch) on Apr 17, 2007 at 18:52 UTC |