password.pm
branchfoerste
changeset 48 36aca6fb0ab8
parent 0 2a5f2464f8c6
equal deleted inserted replaced
47:05d5ada37387 48:36aca6fb0ab8
     3 sub ask($) {
     3 sub ask($) {
     4     local $| = 1;
     4     local $| = 1;
     5     return undef if not -t;
     5     return undef if not -t;
     6 
     6 
     7     print $_[0];
     7     print $_[0];
     8     system(stty => "-echo");
     8     system( stty => "-echo" );
     9     my $ans = <STDIN>;
     9     my $ans = <STDIN>;
    10     system(stty => "echo");
    10     system( stty => "echo" );
    11     print "\n";
    11     print "\n";
    12 
    12 
    13     chomp $ans;
    13     chomp $ans;
    14     return $ans;
    14     return $ans;
    15 }
    15 }