469,266 Members | 1,679 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,266 developers. It's quick & easy.

How to hide password

Hi All,
I would like to get the passwordf from the user,
I need to hide the password , replace it with '*' or not type user input,
I don't want to use a package such as 'ReadKey' or any other
How can I get the password and hide it?

Thanks,
Ronen
May 13 '07 #1
4 15547
miller
1,089 Expert 1GB
Hello Ronen,

Look into the following cpan module:
cpan Term::InKey

Even if you don't want to use a package, you can still download the module and look at it's source to determine a way that you could code it all yourself.

- Miller
May 13 '07 #2
system('stty','-echo');
chop($password=<STDIN>);
system('stty','echo');
May 28 '07 #3
ketanm
8
Hi all,
I also want to hide password.i tried below solution in winxp but i got the error "'stty' is not recognized as an internal or external command,operable program or batch file.".

how could i avoid this error?

Thanks.
Sep 7 '10 #4
hi ketanm,

Maybe more than a bit too late a reply for you, but you can use the Term::ReadKey module for this. Here is how:

use strict;
use warnings;
use Term::ReadKey;

ReadMode = 'noecho';
my $password = <>;
Jan 15 '13 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by william cline | last post: by
12 posts views Thread by Sharon | last post: by
1 post views Thread by Jurij P | last post: by
2 posts views Thread by emerth | last post: by
7 posts views Thread by cefrancke | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.