develooper Front page | perl.beginners | Postings from December 2001


Thread Previous
Curtis Poe
December 20, 2001 08:34
Message ID:
--- walter valenti <> wrote:
> Hi,
> someone knows, how insert text gron STDIN, without see this on the
> shell??
> For example for insert a password..


I *think* what you are asking is "How do I get a password from STDIN without it showing up on the

    use Term::ReadKey;

    $password = ReadLine(0);

I've never used that before but some may be curious how I found it.  Here's the trick:

    perldoc perltoc > perltoc.txt

That pipes the perltoc (Perl Table of Contents) to a text file.  I sometimes scan through this
file to pick up new tricks.  When I see something that interests me (such as "password"), I scan
through the relevant entries.  In this case, I saw the following entries:

    How do I clear the screen?
    How do I get the screen size?
    How do I ask the user for a password?
    How do I read and write the serial port?

The one about asking a user for a password looked useful, so I typed in:

    perldoc -q "How do I ask the user for a password?"

That actually gave a lot more information than what I sent you, so you should give it a try :)

The '-q' options stands for "FAQ keyword", but it can just as easily stand for 'question'.

Curtis "Ovid" Poe

"Ovid" on
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A

Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at
or bid at

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About