in reply to Re^3: Regex arrow key problem
in thread Regex arrow key problem

I know, I was just using an example. 0x25 is left arrow and 0x27 is right, but it won't work when I put it in as
if ($input =~ m/\x25/)

Replies are listed 'Best First'.
Re^5: Regex arrow key problem
by ikegami (Patriarch) on Dec 01, 2010 at 19:53 UTC
    0x25 is the percent sign, 0x27 is the apostrophe. What are you talking about?
      My source must have been incorrect then. What is, or is there, the code for left and right arrow keys?

        According to others in this thread, it's

        "\e", then "[", then "D" ==eq==> "\x1B", "\x5B", "\x44" "\e", then "[", then "C" ==eq==> "\x1B", "\x5B", "\x45"

        (Each of the three values are returned by different calls to ReadKey.)

        Based on what you said you have,

        "\e[D\n" ==eq==> "\x1B\x5B\x44\x0A" "\e[C\n" ==eq==> "\x1B\x5B\x45\x0A"

        Update: Fixed first half.