my @integers = map { int } @list; my $sth->prepare(" SELECT foo FROM bar WHERE id IN (".join(',',@integers).") ");