in reply to DBI select IN Array

Use the pram/baby cart, young Jedi!
my @tagList=('red','black'); my $sql="SELECT table FROM tags WHERE tag IN (@{[join(', ', ('?') x @t +agList)]})"; print $sql,"\n";
yields
SELECT table FROM tags WHERE tag IN (?, ?)

Replies are listed 'Best First'.
Re^2: DBI select IN Array
by Tux (Canon) on Feb 20, 2019 at 15:41 UTC

    Or use $":

    local $" = ","; my $sql = "select table from tags where tag in (@{[('?')x@taglist]})";

    Enjoy, Have FUN! H.Merijn