Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Answer: How do I make password prompts not echo back the user?

( #33360=categorized answer: print w/ replies, xml ) Need Help??

Q&A > input and output > How do I make password prompts not echo back the user? contributed by Fastolfe

The easiest solution, under Unix at least, is to call 'stty' to change the terminal's "echo" attribute. I know of no way to do this under Windows or any non-Unix platform, and there may be a more standardized way of doing this (such as via curses or some Term-based module):
print "login: " my $login = <>; print "Password: " system('/usr/bin/stty', '-echo'); # Disable echoing my $password = <>; system('/usr/bin/stty', 'echo'); # Turn it back on

Comment on Answer: How do I make password prompts not echo back the user?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2014-10-23 04:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (124 votes), past polls