http://qs321.pair.com?node_id=307154


in reply to Reading password from STDIN without echoing

Please NOTE! this is a NOT recommended method of hiding passwords, but to answer your question, keep the password from being seen?

Look at Term::ReadKey

#! /use/bin/perl use strict; use Term::ReadKey; ReadMode( "noecho"); print "Enter pwd please :"; chomp (my $pwd = <>); ReadMode ("original") ; print "\nYou typed $pwd!\n";

Update: This has been tested on a Win32 platform.

-----
Of all the things I've lost in my life, its my mind I miss the most.

Replies are listed 'Best First'.
Re: Re: Reading password from STDIN without echoing
by gitarwmn (Beadle) on Nov 14, 2003 at 19:09 UTC
    So you mention that the above is not the recommoned method of hiding passwords. Can I ask what is? By the way thanks for answering my question.