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!
In reply to Re: Reading Single Character Input with Term::ReadKey
by BrowserUk
in thread Reading Single Character Input with Term::ReadKey
by qazwart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |