in reply to Perl performance in HP-UX

You're shelling out to call stty twice. On a heavily loaded machine doing that could probably take a noticeable amount of time. Consider using Term::ReadKey or the POSIX termios stuff instead.