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.
Please see below when I run this code,#!/usr/bin/perl use strict; use Term::ReadKey; ReadMode( 'cbreak' ); while (1) { my $char = ReadKey( 0 ); print "Character: $char\n"; } ReadMode( 'normal' );
Can anyone explain this? Or how do I capture the arrow keys?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
Back to
Seekers of Perl Wisdom