in reply to Regex arrow key problem
I would suggest you check to make sure that the codes you are getting correspond to what you expect, perhaps with some code similar to
use strict; use warnings; use Term::ReadKey; ReadMode(4); my %keys = GetControlChars; my $int = $keys{INTERRUPT}; while ((my $input = ReadKey(0)) ne $int) { print ord($input), "\n"; } print ord($input), "\n"; ReadMode(0);
I would also suggest you likely want to use equality (as I've done above, see perlop) instead of regular expressions (perlre). As well, see Term::ReadKey, which does not contain a Readmode method (Perl is case sensitive).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex arrow key problem
by austin43 (Acolyte) on Dec 01, 2010 at 20:17 UTC | |
by kennethk (Abbot) on Dec 01, 2010 at 20:28 UTC | |
by austin43 (Acolyte) on Dec 01, 2010 at 20:40 UTC | |
by kennethk (Abbot) on Dec 01, 2010 at 20:56 UTC | |
by austin43 (Acolyte) on Dec 01, 2010 at 21:20 UTC |