in reply to using \x in regex
if ($key eq "~") { # it's a tilde } elsif ($key eq "\e[5~") { # pgup } elsif ($key eq "\e[6~") { # pgdown } [download]