in reply to Prompt for password and display it as asterisks (******)

Is this a CGI or a CLI script?

If the former, then then you can just use a password field. From the CGI docs:

CREATING A PASSWORD FIELD print $query->password_field(-name=>'secret', -value=>'starting value', -size=>50, -maxlength=>80); -or- print $query->password_field('secret','starting value',50,80 +); password_field() is identical to textfield(), except that its c +ontents will be starred out on the web page.

If it's a CLI script (and you can't/wont use an external module), then you can just put the terminal into "no echo" mode with a system call to stty. The following example is from perldoc perlfunc:

system "stty -echo"; print "Password: "; chomp($word = <STDIN>); print "\n"; system "stty echo";

For a more portable solution, you'll need to use Term::ReadKey

Cheers,
Darren

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.