Funny you just caught me working on something similar, and I have modified
this code for my purposes. This should lead you in the right direction!
Snip
#!/usr/bin/perl
use Win32::Console;
$StdIn = new Win32::Console(STD_INPUT_HANDLE);
my $Password = "";
$StdIn->Mode(ENABLE_PROCESSED_INPUT);
print "Enter Password: ";
while (my $Data = $StdIn->InputChar(1)) {
if("\r" eq $Data ) {
last;
} elsif ("\ch" eq $Data ) {
if( "" ne chop( $Password )) {
print "\ch \ch";
}
next;
}
$Password .=$Data;
print "*";
}
print "\n $Password\n";
<STDIN>
#note take out this print so it doesn't display to the user;)
Ned Cunningham
POS Systems Development
Monro Muffler Brake
200 Holleder Parkway
Rochester, NY 14615
(585) 647-6400 ext. 310
[EMAIL PROTECTED]
-----Original Message-----
From: Anbu Pugaleesan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 02, 2003 11:11 AM
To: Beau E. Cox
Cc: [EMAIL PROTECTED]
Subject: Re: Hide password in MS DOS
Hi Beau,
I would wish to have a code snippet using Win32::Console, becoz
this module
is available with me,
Else I may need to install Term::ReadKey.
-anbu
____________________________________________________________________________
_______
mailto:[EMAIL PROTECTED]
"Beau E. Cox" wrote:
> ----- Original Message -----
> From: "Anbu Pugaleesan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, September 01, 2003 7:18 PM
> Subject: Hide password in MS DOS
>
> > Hi all,
> >
> > I need to hide the password from STDIN while the user is keying.
> > In unix I have an option like 'stty -echo', but any suggestion
in doing
> > the same in MS-DOS.
> >
> > thanks,
> > anbu
> >
>
____________________________________________________________________________
> _______
> >
> > mailto:[EMAIL PROTECTED]
>
> Hi -
>
> Win32::Console works well for this. I can post
> a snippet of how it used it (for hiding passwords)
> if you wish.
>
> Aloha => Beau;
> == please visit ==
> <http://beaucox.com> => main site
> <http://howtos.beaucox.com> => howtos
> <http://PPM.beaucox.com> => perl PPMs
> <http://CPAN.beaucox.com> => CPAN
> == thank you ==
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]