in reply to Re: How do I make password prompts not echo back the user?
in thread How do I make password prompts not echo back the user?
...so you only print the password prompt when echo has already been disabled. This makes your program more compatible with things like Expect, which may not wait long enough after the prompt for the echo to be disabled before sending the password.use Term::ReadKey; ReadMode('noecho'); # don't echo print "Type your password:"; chomp(my $password = <STDIN>); ReadMode(0); # back to normal
|
---|