Even clearer would be to hide that in a constant rather than having a bare magic number . . .
use constant HELP_KEY => chr( 8 ); ## Control H if( HELP_KEY() eq $key ) { ## . . . }
Alternately:
use Readonly; Readonly my $HELP_KEY => chr( 8 ); ## Control H if( $HELP_KEY eq $key ) { ## . . . }
In reply to Re^2: Reading Single Character Input with Term::ReadKey
by Fletch
in thread Reading Single Character Input with Term::ReadKey
by qazwart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |