++ Great snippet, I actually have a use for this.
May I suggest inserting the following, just before your 'use Term::ReadKey;' line?
$|=1; #Turn on AutoFlush
On my system (Sun solaris 9 perl 5.8.0) I was consistently seeing 1 less asterisk until I hit the enter key. This should provide a little less confusion for folks entering passwords and not seeing asterisks echoed immediately.
Thanks.
Very funny Scotty... Now PLEASE beam down my PANTS!