daniel at stiw.org
Thu Aug 4 07:58:18 GMT 2005
On Thu, 04 Aug 2005 09:38:15 +0800, Michael Beattie <mtbeedee at gmail.com>
> On 8/3/05, Wouter van Rooij <aentgood at gmail.com> wrote:
>> At the first place, sorry for my bad English.
>> My question is:
>> How can you, when you're writing a perl program, make a input
>> (<stdin>) hidden, so that when someone is typing an input in the
>> following program is hidden:
>> print "Your name:";
>> $name = <STDIN>
>> I would like to get the input like this: ********
The PERL Cookbook seems to have the answer.
You want to read input from the keyboard without the keystrokes being
echoed on the screen. For instance, you want to read passwords as passwd
does, i.e. without displaying the user's password.
Use the CPAN module Term::ReadKey, set the input mode to noecho, and then
$password = ReadLine(0);
More information about the freebsd-questions