in reply to Password masking

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:
I didn't try it out, but it looks to be exactly what you need.

djw