http://www.perlmonks.org?node_id=798213

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to capture the upper, lower, left, and right arrow keys using the code below.
#!/usr/bin/perl use strict; use Term::ReadKey; ReadMode( 'cbreak' ); while (1) { my $char = ReadKey( 0 ); print "Character: $char\n"; } ReadMode( 'normal' );
Please see below when I run this code,
When I type 'c', I get this which is okay. Character: c When I hit 'the upper arrow', I get this output. Character: Character: [ Character: A
Can anyone explain this? Or how do I capture the arrow keys?