password.pm
changeset 0 2a5f2464f8c6
child 48 36aca6fb0ab8
equal deleted inserted replaced
-1:000000000000 0:2a5f2464f8c6
       
     1 package password;
       
     2 
       
     3 sub ask($) {
       
     4     local $| = 1;
       
     5     return undef if not -t;
       
     6 
       
     7     print $_[0];
       
     8     system(stty => "-echo");
       
     9     my $ans = <STDIN>;
       
    10     system(stty => "echo");
       
    11     print "\n";
       
    12 
       
    13     chomp $ans;
       
    14     return $ans;
       
    15 }
       
    16 
       
    17 1;
       
    18 
       
    19 # vim:sts=4 sw=4 aw ai sm: