perldoc -q password

How do I ask the user for a password?

(This question has nothing to do with the web.  See a different
FAQ for that.)

There's an example of this in L<perlfunc/crypt>).  First, you put
the terminal into "no echo" mode, then just read the password
normally.  You may do this with an old-style ioctl() function, POSIX
terminal control (see L<POSIX>, and Chapter 7 of the Camel), or a call
to the B<stty> program, with varying degrees of portability.

You can also do this for most systems using the Term::ReadKey module
from CPAN, which is easier to use and in theory more portable.

    use Term::ReadKey;

    ReadMode('noecho');
    $password = ReadLine(0);


-----------------------------------------
Craig Moynes
[EMAIL PROTECTED]



                                                                                       
                                                  
                      "Ravindranath,                                                   
                                                  
                      Sujit"                     To:       [EMAIL PROTECTED]          
                                                  
                      <sujit.ravindranath        cc:                                   
                                                  
                      @attws.com>                Subject:  Password entry field.       
                                                  
                                                                                       
                                                  
                      08/27/2002 02:55 PM                                              
                                                  
                                                                                       
                                                  
                                                                                       
                                                  



Hi all,
I am using PERL to write a terminal(UNIX) program wherein it prompts the
user for some information, including a password field.
Now,is there a way I can set this up so that the user-input key-strokes
show
up as asterisks on the screen ?

Thanks
Sujit Ravindranath
AT&T Wireless Services



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to