in reply to Comparing an array to a DBI table

It's MUCH easier to grab the IDs from the DBI first, and whittle down from there. Note that to save time, everything's going into a hash instead of an array...

my $sth = $dbh->prepare("SELECT userid FROM subscription") or die DBI: +:errstr; $sth->execute() or die DBI::errstr; my %db; while( my ( $id ) = $sth->fetchrow_array() ) { $db{ $id } = 1; } my @in_db = grep { defined( $db{ $_ } ) } @compare_array;

Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain