[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Password Dialog



At 17.34 -0400 1998.08.05, w e b s l a v e wrote:
>Is there an easy way to have a dialog not show the characters entered?
>
>MacPerl::Ask is a good thing, but I want either bullet characters or nothing
>dsiplayed when I type.

Alan Fry had one, check the archives for "HideDialogItem".

>Otherwise, is there a STDIN solution?

Yes.  This should work, I think:

#!perl -w
print "Enter your password: ";
`stty raw`;
chomp($pass = <STDIN>);
print "Your password is $pass\n";
`stty sane`;
__END__

But in actuality, it does not work for me.  Hrm.  I get:

Enter your password: # Use of uninitialized value.
File 'Untitled #4'; Line 4
# Use of uninitialized value.
File 'Untitled #4'; Line 5
Your password is

It works fine without the stty call; of course, then you can see the input.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch