Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Password masking

by djw (Vicar)
on May 02, 2002 at 17:49 UTC ( [id://163612]=note: print w/replies, xml ) Need Help??


in reply to Password masking

You may want to take at a look at Term::ReadKey from CPAN. From the docs:

The terminal mode function is controlled by the "ReadMode" function, which takes a single numeric argument, and an optional filehandle. This argument should be one of the following:
  • 0: (Reset) Restore original settings.
  • 1: (Cooked) Change to what is commonly the default mode, echo on, buffered, signals enabled, Xon/Xoff possibly enabled, and 8-bit mode possibly disabled.
  • 2: (Cooked-Invisible) Same as 1, just with echo off. Nice for reading passwords.
  • 3: (CBreak) Echo off, unbuffered, signals enabled, Xon/Xoff possibly enabled, and 8-bit mode possibly enabled.
  • 4: (Raw) Echo off, unbuffered, signals disabled, Xon/Xoff disabled, and 8-bit mode possibly disabled.
  • 5: (Really-Raw) Echo off, unbuffered, signals disabled, Xon/Xoff disabled, 8-bit mode enabled if parity permits, and CR to CR/LF translation turned off.

I didn't try it out, but it looks to be exactly what you need.

djw

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found