Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Reading password from STDIN without echoing

by AcidHawk (Vicar)
on Nov 14, 2003 at 18:59 UTC ( #307154=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://307154]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2021-02-27 17:09 GMT
Find Nodes?
    Voting Booth?

    No recent polls found