+sub GetPassword (;$) {
+ my ($prompt) = @_;
+
+=pod
+
+=head2 GetPassword (;$prompt)
+
+Prompt for a password
+
+Parameters:
+
+=for html <blockquote>
+
+=over
+
+=item $prompt
+
+Prompt string to use (Default: "Password:")
+
+=back
+
+=for html </blockquote>
+
+Returns:
+
+=for html <blockquote>
+
+=over
+
+=item $password
+
+=back
+
+=for html </blockquote>
+
+=cut
+
+
+ $prompt ||= 'Password';
+
+ my $password;
+
+ local $| = 1;
+
+ print "$prompt:";
+
+ $SIG{INT} = \&_restoreTerm;
+
+ ReadMode 'cbreak';
+
+ while () {
+ my $key;
+
+ while (not defined ($key = ReadKey -1)) { }
+
+ if ($key =~ /(\r|\n)/) {
+ print "\n";
+
+ last;
+ } # if
+
+ print '*';
+
+ $password .= $key;
+ } # while
+
+ ReadMode 'restore'; # Reset tty mode before exiting.
+
+ $SIG{INT} = 'DEFAULT';
+
+ return $password;
+} # GetPassword
+