On Fri, May 25, 2001 at 02:54:36PM -0400, [EMAIL PROTECTED] wrote:
: 
: Hi,
: 
: I've got a Perl script that logs into one of our applications as Admin.  I
: didn't want to hard code in the password, so I'm prompting for it.  I was
: looking for a way to hide the input, just like when you log into a Unix or NT
: box.  I was hoping to either have the actual input chars replaced with '*'s or
: just blanks or something along those lines.
: 
: Any ideas?

Term::ReadKey

Here is an example:

  use Term::ReadKey;

  print "Type password: ";

  ReadMode 2;
  chomp( my $pass = <STDIN> );

  ReadMode 0;
  print "\n";

ReadMode 2 will supress the echo of keys pressed by the user.

Don't forget to read the perldoc of Term::ReadKey

  Casey West

-- 
If unix is the face of the future I wanna go back to quill pens. 
 -- Joseph Snipp

Reply via email to