in reply to Editing STDIN
This is a FAQ. perldoc -q password gives perlfaq8, especially How do I ask the user for a password?