in reply to Database matching

It's a little difficult to parse :), and as ever,it'd help if you posted some more code, but maybe you're simply looking for something like...
if ($dbm{$accountAD} eq $accountID){ do_something(); # got an existing one; } elsif (defined $dbm{$accountAD}) { do_something_else(); # a mismatch? } else { $dbm{$accountAD} = $accountID; #set a new one }
Hope this helps.