Submitted by Daniel Drucker (not verified) on Fri, 2004-10-29 15:29.
# let's figure out who we're talking to
my $term = new Term::ReadLine::Gnu;
my $termattribs = $term->Attribs;
$termattribs->{redisplay_function} = $termattribs->{shadow_redisplay};
my $pass = $term->readline("mail password (echos stars): ");
$term->remove_history($term->where_history);
my $sth = $dbh->prepare("SELECT user FROM passwd WHERE clear = ?");
$sth->execute($pass) || die $dbh->errstr;;
if ($sth->rows == 1)
{
$h = $sth->fetchrow_hashref;
$user = $h->{user};
}
else
{
die "Incorrect password\n";
}
# let's figure out who we're talking to
my $term = new Term::ReadLine::Gnu;
my $termattribs = $term->Attribs;
$termattribs->{redisplay_function} = $termattribs->{shadow_redisplay};
my $pass = $term->readline("mail password (echos stars): ");
$term->remove_history($term->where_history);
my $sth = $dbh->prepare("SELECT user FROM passwd WHERE clear = ?");
$sth->execute($pass) || die $dbh->errstr;;
if ($sth->rows == 1)
{
$h = $sth->fetchrow_hashref;
$user = $h->{user};
}
else
{
die "Incorrect password\n";
}