my @tagList=('red','black'); my $sql="SELECT table FROM tags WHERE tag IN (@{[join(', ', ('?') x @tagList)]})"; print $sql,"\n";