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?

Another methood is this:
system('stty -echo'); print "Enter Password: "; chomp($pw = <STDIN>); system('stty echo');

The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows. - Frank Zappa
  • Comment on Re: Answer: How do I make password prompts not echo back the user?
  • Download Code

Replies are listed 'Best First'.
Re: Answer: How do I make password prompts not echo back the user?
by skx (Parson) on Oct 23, 2003 at 11:19 UTC

     This works but there are two caveats you should bear in mind:

    • If you're running the script as a priviledged process you might have just opened yourself to a local attack, if the user can modify their path and slip in a trojan 'stty' binary.
    • This fails utterly on Windows, amongst other systems.
    Steve
    ---
    steve.org.uk