You may want to take at a look at Term::ReadKey from CPAN.
From the docs:
The terminal mode function is controlled by the "ReadMode" function, which takes a single numeric argument, and an optional filehandle. This argument should be one of the following:
0: (Reset) Restore original settings.
1: (Cooked) Change to what is commonly the default mode, echo on, buffered, signals enabled, Xon/Xoff possibly enabled, and 8-bit mode possibly disabled.
2: (Cooked-Invisible) Same as 1, just with echo off. Nice for reading passwords.