I am sure there are way better ways, in my case I am using the base load of
Perl.  I have over a 1000 computers with this same load that I need to be
able to update and Win32::Console is loaded already.  I wish I had TK loaded
but I don't, so I use what I have :-)
I just happened to be walking through Dave Roth's WIN32 Perl programming in
the section on console, so I thought I would give it a shot.
Sorry if I mislead anyone, still a newbie:(

Ned Cunningham
POS Systems Development
Monro Muffler Brake
200 Holleder Parkway
Rochester, NY 14615
(585) 647-6400 ext. 310
[EMAIL PROTECTED]

                -----Original Message-----
                From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
                Sent:   Tuesday, September 02, 2003 1:01 PM
                To:     Ned Cunningham
                Subject:        RE: Hide password in MS DOS

                Why don't you use the Term::ReadKey?

                I thinks that it does the some job!



                Quoting Ned Cunningham <[EMAIL PROTECTED]>:

                > 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]
                > 

                

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to