Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User entering a password 2

Status
Not open for further replies.

carlg

Programmer
Joined
Jun 23, 2004
Messages
88
Location
US
I have an interactive Perl script. The user gets prompted for some information and as the user types his repsonse, it is also displayed on the screen.

One of the things to enter is a passowrd variable. Is there a way to allow the user to enter the password, but not have it echo to the screen, but still capture the input?

Thanks for the info
 
is there a reason you are not using a form and submitting it to the perl scripts, that way the form/browser deals with masking the password.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
It's not a web based application.

It's just a DOS command line application that gets run like the following.


perl myprogram.pl

 
can you tell perl to use an input mask when promting for input ?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Great idea thanks, but that seems to be the Unix version.

I'm working from the DOS prompt.

 
nice one!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Install the module Term::InKey. It is available via PPM. Use the following code.

Code:
use Term::InKey;
$|++;
print "Press any key to clear the screen: ";
$x = &ReadPassword;
&Clear;
print "You pressed $x\n";

This is just a test sample to display the program's capability. Modify to suit your needs.

Hth,

Raklet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top