Hi, I am writing a Win32 script to accept a user name and password. When the user types the password, the text should not be displayed on the screen. I used Term::ReadKey and wrote a code as follows.
print "User name: "; chop ($name=<STDIN>); if ($name eq "") { die "Invalid user"; }else{ print "Password :"; my $pass = ReadKey(2); }
After entering the username, the cursor is not appearing in the screen and if I hit any key, the program terminates after reporting invalid password. Can anyone tell me how to hide the display of password when typing it on the screen?
In reply to Suppressing display of text in the screen by rsriram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |