Have a look at Term::ReadKey ...

You need to set noecho (i think...)


On Fri, 2003-01-10 at 11:32, Jose Malacara wrote:
> Is there a way for perl to suppress or mask user input at the STDIN? For example, a 
>password or login prompt.... Not really trying to implement any real security here, 
>just curious.
> 
> This is what I I would like:
> 
> Enter your login:            # suppressed from output
> Welcome, admin.
> 
> or
> 
> Enter your login: *****    # masked by asterisks
> Welcome, admin.
> 
> 
> 
> #!/usr/bin/perl
> 
> &prompt;
> 
> sub prompt {
>   print "Enter your login: ";
>   $login = <STDIN>;
>   chomp ($login);
>   &check($login);
> }
> 
> sub check {
>   if ($login ne "admin") {
>         &prompt;
>     }else{
>         print "Welcome, $login\n";
>     }
> }
> 
> 
> Thanks!


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

Reply via email to