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

The left arrow key is returning "\e[D\n", and the right arrow key is returning "\e[C\n". How do I match this?

Replies are listed 'Best First'.
Re^3: Regex arrow key problem
by ikegami (Patriarch) on Dec 01, 2010 at 19:41 UTC
    if ($input eq "\e[D\n")
    and
    if ($input eq "\e[C\n")

    You obviously removed the lc to get those values. Be careful about re-adding lc. Only lowercase $input after checking for these special keys.

      I tried your code, with and without lc, and it didn't work still.

        Impossible. Either you didn't run the code I gave you, you didn't give me the output you got, or you changed something else.