Skip navigation.
Home

Add new comment


# 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";
}

Reply




*

  • Web and e-mail addresses are automatically converted into links.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br /> <br>