elsif ($get eq "password") { # Get user's e-mail my $username = param('username'); if ($username) { my $sql = "SELECT * from $meta_configs{login_table} where $meta_configs{login_username} LIKE '$username'"; my $sth = $dbh->prepare("$sql") or &graceful_exit("Cannot prepare SQL statement: $DBI::errstr",$sql); $sth->execute or graceful_exit("Cannot execute: $DBI::errstr",$sql); my $rows = $sth->rows; my $email; my $db_username; my $password; while (my $hash_ref=$sth->fetchrow_hashref) { $email = $hash_ref->{email}; $db_username = $hash_ref->{"$meta_configs{login_username}"}; $password = $hash_ref->{password}; } $sth->finish; # send password: open (MAIL, "| /usr/lib/sendmail $email");