in reply to Rewrite in a more compact way

Does the x operator help?

my @placeholders = ('?') x $n; my $str = sprintf <<'SQL', join ",", @placeholders; CALL DB_PROC_FOO(%s); SQL

Sometimes I also use <<'' instead of <<'SQL' but I find that I tend to insert blank lines into my SQL to structure it better, so that's a practice that leads to inconvenient errors.

Maybe you want to give SQL::Abstract a try, but in the long run, I found that I ended up fighting SQL::Abstract's ideas of how I should structure my data to get the SQL I want, and it was faster for me to just interpolate a string.