my ($mail, $status, $new_status, $spam); while(my ($mail_id, $mail_body) = $sth->fetchrow_array ) { $mail_body = qq{$mail_body}; ## $mail_body = text inhalt ohne html $mail = $spamtest->parse($mail_body); $status = $spamtest->check($mail); if ( $status->is_spam() ) { $new_status = 1; print 'spam'; } else { $new_status = 0; print 'kein spam'; } }