This is a FAQ. perldoc -q password gives perlfaq8, especially How do I ask the user for a password?
In reply to Re: Editing STDIN by Corion in thread Editing STDIN by Andrew_Levenson