=cut
-
$prompt ||= 'Password';
- my $password;
+ my $password = '';
local $| = 1;
last;
} # if
- print '*';
+ # Handle backspaces
+ if ($key eq chr(127)) {
+ unless ($password eq '') {
+ chop $password;
+
+ print "\b \b";
+ } # unless
+ } else {
+ print '*';
- $password .= $key;
+ $password .= $key;
+ } # if
} # while
ReadMode 'restore'; # Reset tty mode before exiting.
=cut
- open my $pipe, '|-', $to
+ open my $pipe, '|', $to
or error "Unable to open pipe - $!", 1;
foreach (@output) {