my $sql = "update table set Y=0 where X in (" . join( ',', map { '?' } @ARRAY ) . ")"; my $sth = $dbh->prepare( $sql ); $sth->execute( @ARRAY );