in reply to DBI and variable numbers of bind parameters

I'm actually surprised that you say your first approach works. It doesn't seem to work for me, unless the string being passed for the single placeholder happens to contain only one field value:
my $in = "a,b"; my $sth = $dbh->prepare("SELECT foo FROM bar WHERE baz IN (?)"); $sth->execute( $in ); # fetch returns no results -- it would work if $in were just "a" my @in = qw/a b/; $sth = $dbh->prepare("SELECT foo FROM bar WHERE baz in (?,?)"); $sth->execute( @in ); # fetch returns expected results for "a" and "b"
(I'm using perl 5.8.6 on freebsd, with mysql 4.0.21)

Given that circumstance, I would definitely use the  join( ',', map {'?'} @ins approach for putting together the text for the sql select statement (like davidrw showed in his reply).