Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am writing a script which needs to ask for a password and send it on to an existing program. Now, I don't want to just:

print "what's the password? "; my $pass = <STDIN>;

because this will obviously leave the password right there on the screen for anyone walking by to look at. Normally in unix, you just get a prompt to type at that no letters actually appear at when you type. How do I duplicate this behavior in Perl?

Thanks in advance.

Replies are listed 'Best First'.
Re: hidden input
by chromatic (Archbishop) on Jan 20, 2001 at 07:23 UTC
Re: hidden input
by I0 (Priest) on Jan 20, 2001 at 03:49 UTC
Re: hidden input
by myocom (Deacon) on Jan 20, 2001 at 02:49 UTC

    Type 'hidden password' in the search box up there in the upper left corner of your screen, and be amazed at all the results.

53137
by I0 (Priest) on Jan 20, 2001 at 03:35 UTC
        Trying to decide if your post was a mistake or cunning humor. Given your reputation for terseness, I'll assume the latter :)

        Cheers,
        Ovid

        Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.