How can I request a password from a terminal user without entering a password in the terminal? There is a similar question for How can I enter a password using Perl and replace the characters with "*"? but the answers seem outdated or broken.
I searched for answers to this question and was not satisfied with the questions on the later pages of the results, which answered tangentially to other problems.
In addition, perlfaq8 has an example that is incomplete (oh, and who used to do this;).
use Term::ReadKey; ReadMode('noecho'); my $password = ReadLine(0);
When you do this without resetting the terminal, nothing more! Unfortunately,
I am also looking for new answers or modules that we can provide to those who want to do this.
terminal passwords perl
brian d foy
source share