For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > November 2005 > how to hide passwd from INPUT









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to hide passwd from INPUT
Jennifer Garner

2005-11-29, 6:57 pm

HI,Lists,

Sorry, this time I can't login into my primary mailbox of 30gigs.So I
change another email for this question.

When I get something from input such as:

my $passwd=<STDIN>;

the password typed on screen is clear plain text.How can I get it input
as hide type such as ***?Thanks.


---
Jennifer

--
Sent using Laszlo Mail. Try it yourself.
http://www.laszlomail.com

Xavier Noria

2005-11-29, 6:57 pm

On Nov 29, 2005, at 15:40, Jennifer Garner wrote:

> HI,Lists,
>
> Sorry, this time I can't login into my primary mailbox of 30gigs.So
> I change another email for this question.
>
> When I get something from input such as:
>
> my $passwd=<STDIN>;
>
> the password typed on screen is clear plain text.How can I get it
> input as hide type such as ***?Thanks.


Some modules provide that, for instance IO::Prompt.

-- fxn

John Doe

2005-11-29, 6:57 pm

Jennifer Garner am Dienstag, 29. November 2005 15.40:
> HI,Lists,
>
> Sorry, this time I can't login into my primary mailbox of 30gigs.So I
> change another email for this question.
>
> When I get something from input such as:
>
> my $passwd=<STDIN>;
>
> the password typed on screen is clear plain text.How can I get it input
> as hide type such as ***?Thanks.


perldoc -q password

=>

"How do I ask the user for a password?"
"...
use Term::ReadKey;

ReadMode('noecho');
$password = ReadLine(0);
...."

I would add a

ReadMode('normal');

otherwise your terminal could stay in noecho mode.

hth, joe
Jennifer Garner

2005-11-30, 3:56 am


Thanks for John and all.

On Tue, Nov 29, 2005 at 10:53 PM, John Doe wrote:

> Jennifer Garner am Dienstag, 29. November 2005 15.40:
>
> perldoc -q password
> =>
> "How do I ask the user for a password?"
> "...
> use Term::ReadKey;
>
> ReadMode('noecho');
> $password = ReadLine(0);
> ..."
>
> I would add a
> ReadMode('normal');
>
> otherwise your terminal could stay in noecho mode.
>
> hth, joe
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>



--
Sent using Laszlo Mail. Try it yourself.
http://www.laszlomail.com

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com