Andrew_Levenson has asked for the wisdom of the Perl Monks concerning the following question:
Would there be a way to edit STDIN _BEFORE_ it is displayed on the screen?
SMayper and I are going to design, for fun, a file system with user logins, but we don't want the password to actually show on the screen when they type it to log in.
One of our competition questions requests that we display input using asterisks, so we know that it can't be something too difficult and obscure if we're asked to do it in competition (where most of the questions have us counting certain character -- thank you, perl. If only they knew...).
Thanks in advanced!
SMayper and I are going to design, for fun, a file system with user logins, but we don't want the password to actually show on the screen when they type it to log in.
One of our competition questions requests that we display input using asterisks, so we know that it can't be something too difficult and obscure if we're asked to do it in competition (where most of the questions have us counting certain character -- thank you, perl. If only they knew...).
Thanks in advanced!
C(qw/74 97 104 112/);sub C{while(@_){$c**=$C;print (map{chr($C!=$c?shift:pop)}$_),$C+=@_%2!=1?1:0}}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Editing STDIN
by Corion (Patriarch) on Dec 16, 2006 at 15:54 UTC | |
Re: Editing STDIN
by vladdrak (Monk) on Dec 16, 2006 at 20:28 UTC | |
by rodion (Chaplain) on Dec 17, 2006 at 14:27 UTC | |
by Not_a_Number (Prior) on Dec 16, 2006 at 20:52 UTC | |
Re: Editing STDIN
by jdporter (Paladin) on Dec 16, 2006 at 17:44 UTC |
Back to
Seekers of Perl Wisdom