use strict; my $sth = $dbh->prepare("SELECT blah from blah1 where blah1.field = ?"); foreach my $c1(@c1) { $sth->execute($c1); # do stuff }