in reply to Efficiency on Code
The fetch-while DBI part of the question was discussed a few days ago: bind_columns OR fetchall_arrayref.