in reply to DBI prepare() vs do() usage

do() just runs prepare() and execute() under the hood, it's only syntactic sugar on top of them. So a single do() performs exactly the same actions as a single prepre()+execute() combo. The reason it's usually bad for loops is that it does prepare()+execute() each time through the loop when what you usually want is one prepare() at the top and multiple execute()s inside the loop.

The other difference is what's returned. For example if you want to know the names of the columns, you need to use prepare() to get an $sth to use with $sth->{NAME}.

As others have said, do() supports placeholders, so that isn't a reason to avoid it.