http://qs1969.pair.com?node_id=319085

bory has asked for the wisdom of the Perl Monks concerning the following question:

Happy New Year for all the monks! I have the following problem:I want to delete from a database the records that are NOT equal with the elements of an array.
my @test=("Anna","Maria","Carmen") foreach $line(@test){ my $sth=$dbh->prepare(qq{DELETE FROM tnt WHERE `Name`!=\"$lin +e\"}); $sth->execute(); $sth->finish; }
If I have in the database the record "Diana" I want to erase it because it's not an element of the array @test. In the way i do it it deletes all the records from the database. Thank you very much for your time.